Skip to content

Instantly share code, notes, and snippets.

View JonnyFunFun's full-sized avatar

Jonathan Enzinna JonnyFunFun

View GitHub Profile
@JonnyFunFun
JonnyFunFun / assigned_effort_mashup.js
Created November 14, 2012 13:36
Assigned Effort Mashup
tau.mashups
.addDependency('libs/jquery/jquery').addMashup(function() {
function showReport() {
$('head').append('<style type="text/css">'
+'table.board-efforts tr.hoverHi:hover {background: #E3F5D7 !important}'
+'table.board-efforts tr {border-bottom: 1px dotted #eee !important}'
+'table.board-efforts td {height: 20px; }'
+'table.board-efforts td em {font-size: smaller;}'
+'table.board-efforts {border-collapse: collapse;}'
@JonnyFunFun
JonnyFunFun / gist:5348053
Created April 9, 2013 18:19
Super simple mashup that adds an alert message to the header in TargetProcess
tau.mashups
.addDependency("libs/jquery/jquery")
.addMashup(function(config) {
var alertEl = '<br/><br/><div class="alert"><strong>Heads up!</strong> This is an awesome message!</div>';
$(document).ready(function() {
$('div#ctl00_helpPanel').append(alertEl);
});
@JonnyFunFun
JonnyFunFun / gist:5796885
Created June 17, 2013 13:32
Kanban Column Hider mashup with per-project configuration logic
tau.mashups
.addDependency('libs/jquery/jquery')
.addMashup(function ($, config) {
// Put projects => states' names that you want to hide here
// projects can be a regular expression
var statesToHideConfiguration = {
'Private Universe #[0-9]+': ['Invalid', 'Fixed']
};
// gathers the project name from the div.x-panel-kanban-header > span
@JonnyFunFun
JonnyFunFun / CFClassesOfService.js
Last active December 18, 2015 22:09
Custom Field-version of the TargetProcess 3 Classes of Service mashup.
tau.mashups
.addDependency('tp/mashups')
.addDependency('user/mashups')
.addDependency('jQuery')
.addDependency('Underscore')
.addDependency('tp3/mashups/context')
.addDependency('tau/core/bus.reg')
.addDependency('tau/configurator')
.addMashup(function (m, um, $, _, context, busRegistry, configurator) {
@JonnyFunFun
JonnyFunFun / TP3-Project-Specific-COS-Mashup.js
Created July 1, 2013 13:13
TP3 Classes of Service (tag highlighter) mashup with per-project capabilities
tau.mashups
.addDependency('tp/mashups')
.addDependency('user/mashups')
.addDependency('jQuery')
.addDependency('Underscore')
.addDependency('tp3/mashups/context')
.addDependency('tau/core/bus.reg')
.addDependency('tau/configurator')
.addMashup(function (m, um, $, _, context, busRegistry, configurator) {
@JonnyFunFun
JonnyFunFun / Column Hider-All Projects.js
Last active December 19, 2015 12:49
A corrected version of the Kanban Column Hider that will work globally across all projects
tau.mashups
.addDependency('libs/jquery/jquery')
.addMashup(function ($, config) {
// Put states' names that you want to hide here
var statesToHide = ["In Progress", "Fixed"];
for (var i = 0; i < statesToHide.length; i++) {
var headers = $(".kanban-swimlane-header-wrap span:contains('"+statesToHide[i]+"')").filter(function() {
return $(this).text().match("^"+statesToHide[i]) != null;
@JonnyFunFun
JonnyFunFun / Impediment CF Colorer.js
Created July 9, 2013 14:55
Custom-Field version of the TP3 class of service mashup that works with Impediments
tau.mashups
.addDependency('tp/mashups')
.addDependency('user/mashups')
.addDependency('jQuery')
.addDependency('Underscore')
.addDependency('tp3/mashups/context')
.addDependency('tau/core/bus.reg')
.addDependency('tau/configurator')
.addMashup(function (m, um, $, _, context, busRegistry, configurator) {
@JonnyFunFun
JonnyFunFun / reocurring_task.py
Created August 27, 2013 13:42
Simple decorator to use to schedule a function to occur every X seconds
import threading
class ReoccuringTask(object):
def __init__(self, recurrence):
self.schedule = recurrence
def __call__(self, orig_func):
decorator_self = self
@JonnyFunFun
JonnyFunFun / tp api example.php
Created November 25, 2013 15:14
Example on how to consume Targetprocess' REST API with PHP
<?php
define('TP_URL', 'http://enzinna.tpondemand.com/');
define('TP_USER', 'admin');
define('TP_PASS', 'admin');
# GET a story
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, TP_URL."api/v1/UserStories/201?format=json");
from functools import wraps
from django.db.models.signals import pre_save
def full_clean_on_save(cls):
"""
Class decorator that automatically calls full_clean() when a model is saved.
"""
def connect(signal, func):
cls.func = staticmethod(func)
@wraps(func)