Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
Available for training, coaching and trouble-shooting (as usual)..

Jens W. Klein jensens

🕶️
Available for training, coaching and trouble-shooting (as usual)..
View GitHub Profile
@saily
saily / update.sh
Last active Aug 29, 2015
Update buildout including all sources in src dir
View update.sh
#!/bin/sh
spinner() {
# thanks to: http://fitnr.com/showing-a-bash-spinner.html
local pid=$1
local delay=0.075
local spinstr='|/-\'
local infotext=$2
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf "[ %c ] %s" "$spinstr" "$infotext"
@js-dot-js
js-dot-js / rtree.js
Created Aug 7, 2012
Generate dependency tree for RequireJS apps
View rtree.js
// Usage:
//
// 1. Put this in the file that gets first loaded by RequireJS
// 2. Once the page has loaded, type window.rtree.map() in the console
// This will map all dependencies in the window.rtree.tree object
// 3. To generate UML call window.rtree.toUml(). The output can be used
// here: http://yuml.me/diagram/scruffy/class/draw
requirejs.onResourceLoad = function (context, map, depMaps) {
if (!window.rtree) {
window.rtree = {};
@jensens
jensens / dcwf2dot.py
Created Mar 1, 2012
generates dot file from workflows (zope python script)
View dcwf2dot.py
context.REQUEST.response.setHeader('Content-Type', 'text/plain')
print "digraph %s {" % context.getId()
wf = context
state_to_trans = []
for state in wf.states.values():
roles = state.getAvailableRoles()
roles.sort()
permtable = [ ['<FONT POINT-SIZE="10">%s</FONT>' % _ for _ in ['permission', 'acquired'] + roles ] ]
for perm in state.getManagedPermissions():
pinfo = state.getPermissionInfo(perm)
You can’t perform that action at this time.