Skip to content

Instantly share code, notes, and snippets.

Avatar

Danielle Madeley danni

View GitHub Profile
View add-git-into-to-terminal-title.sh
# Create a prompt command function that can set the terminal title with info including your Git branch
__prompt_command() {
# Based on: http://stackoverflow.com/a/13003854/170413
local branch
if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then
if [[ "$branch" == "HEAD" ]]; then
branch='detached'
fi
@danni
danni / fields.py
Created Mar 8, 2016
Multi Choice Django Array Field
View fields.py
from django import forms
from django.contrib.postgres.fields import ArrayField
class ChoiceArrayField(ArrayField):
"""
A field that allows us to store an array of choices.
Uses Django 1.9's postgres ArrayField
and a MultipleChoiceField for its formfield.
@danni
danni / migration_loaddata.py
Last active Sep 12, 2020 — forked from leifdenby/migration_loaddata.py
Django function for loading fixtures which use the current migration state of the model
View migration_loaddata.py
import os
import logging
from django.core import serializers
LOGGER = logging.getLogger(__name__)
def load_fixture(app, fixture, ignorenonexistent=True):
"""
View aloe.diff
diff --git a/aloe/fs.py b/aloe/fs.py
index e2c99f8..51c7ac7 100644
--- a/aloe/fs.py
+++ b/aloe/fs.py
@@ -37,7 +37,6 @@ except NameError:
# pylint:disable=no-name-in-module,redefined-builtin
from importlib import reload
# pylint:enable=no-name-in-module,redefined-builtin
-from os.path import join, dirname
View View_CI_Images.user.js
// ==UserScript==
// @name View CI Images
// @namespace io.ixa.ci
// @description View CI Images
// @version 1
// @match https://gitlabci/projects/*/builds/*
// ==/UserScript==
(function ($) {
var text = $('#build-trace').html();
@danni
danni / Velocity.ipynb
Created Jan 1, 2015
Plot velocity from Redmine
View Velocity.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.