Skip to content

Instantly share code, notes, and snippets.

Jörn Zaefferer jzaefferer

View GitHub Profile
jzaefferer / Validation.jsx
Created Jun 6, 2018
React with jQuery Validation Plugin
View Validation.jsx
/* eslint-disable prefer-arrow-callback */
import $ from 'jquery'
import 'jquery-validation'
import PropTypes from 'prop-types'
import React from 'react'
* @author Algorithm and Datastructures Team SS2016
* @version 1.0
import java.lang.RuntimeException;
public class MyHashMap {
View server.js
var restify = require('restify');
var drc = require('./lib/');
function respond(req, res, next) {
var name =;
var repo = drc.parseRepo(name);
var term = repo.index.official ? repo.localName : repo.remoteName;
jzaefferer /
Last active Mar 13, 2016
GitHub PR boilerplate
View md-generator.js
var fs = require( "fs" ),
request = require( "request" ),
xml2js = require( "xml2js").parseString,
exec = require( "child_process" ).exec,
pages = [1, 2, 3, 4, 5, 6, 7],
team = "core";
pages.forEach(function(page) {
request.get("" + team + "/feed/atom/?paged=" + page, function(request, response, body) {
xml2js(body, {explicitArray: false}, function( err, result ) {
View gist:5154172
Mar 13 07:24:13 nc02[28643]: { core: 'on', widget: 'on', mouse: 'on', position: 'on', draggable: 'on', droppable: 'on', resizable: 'on', selectable: 'on', sortable: 'on', accordion: 'on', autocomplete: 'on', button: 'on', datepicker: 'on', dialog: 'on', menu: 'on', progressbar: 'on', slider: 'on', spinner: 'on', tabs: 'on', tooltip: 'on', effect: 'on', 'effect-blind': 'on', 'effect-bounce': 'on', 'effect-clip': 'on', 'effect-drop': 'on', 'effect-explode': 'on', 'effect-fade': 'on', 'effect-fold': 'on', 'effect-highlight': 'on', 'effect-pulsate': 'on', 'effect-scale': 'on', 'effect-shake': 'on', 'effect-slide': 'on', 'effect-transfer': 'on', 'theme-folder-name': 'smoothness', scope: '' }
Mar 13 01:48:58 nc02[30196]: User request exception:
TypeError: Cannot call method 'components' of undefined
at Object.Builder (/var/www/
at /var/www/
jzaefferer / server.js
Created Mar 26, 2012
Backbone app server - server static files or index.html
View server.js
var connect = require('connect');
var httpPort = 8090;
var httpHost = "localhost";
var staticDir = __dirname;
var staticFiles = /\.(?:js|jpg|png|gif|json|css|ico|html|manifest|mp3|txt)(?:\?.+)?$/;
function route(app) {
app.get(/.*/, function(request, response, next) {
if (!(staticFiles).test(request.url)) {
View gist:1301386

You prolly heard of Brook's law before:

adding manpower to a late software project makes it later

While that is, in Brook's words, a "outrageous oversimplification", it captures a lot value. And as with most things, taking a step back by generalzing it, yields some interesting results.

Consider the recommendation (see for example slide 46 here) that anyone with experience with venture capital funding will give you: Only take funding when you don't need it. In this context, you should use funding to grow a company that already works. If you need money just to keep it running, you might as well stop.

Kind of similar to Brook's law, isn't it? But still, its kind of unintuitive. Let's try another example:

View gist:1298986
Function.prototype.debounce = function(threshold) {
threshold = threshold || 100;
var func = this;
var timeout;
return function() {
var obj = this,
args = arguments;
timeout = setTimeout(function() {
func.apply(obj, args);
jzaefferer / .bash_profile
Last active Sep 27, 2015
git-bash addons
View .bash_profile
# excerpt, I've got my stuff in my file
source ~/.git-completion.bash
source ~/.git-flow-completion.bash
export PS1='\w $(vcprompt)\$ '
alias s="git status"
alias d="git diff"
You can’t perform that action at this time.