Skip to content

Instantly share code, notes, and snippets.

View danni's full-sized avatar

Danielle Madeley danni

View GitHub Profile
@danni
danni / fields.py
Created March 8, 2016 08:52
Multi Choice Django Array Field
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 November 16, 2023 08:28 — forked from leifdenby/migration_loaddata.py
Django function for loading fixtures which use the current migration state of the model
import os
import logging
from django.core import serializers
LOGGER = logging.getLogger(__name__)
def load_fixture(app, fixture, ignorenonexistent=True):
"""
# 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
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
@danni
danni / View_CI_Images.user.js
Last active August 29, 2015 14:15
View CI Images
// ==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 January 1, 2015 11:15
Plot velocity from Redmine
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.