Skip to content

Instantly share code, notes, and snippets.

@jonathanconway
jonathanconway / jquery.prebind.js
Created June 25, 2011 05:53
preBind() - Add an event binding *before* any pre-existing bindings. (An early version, may not work in all scenarios)
$.fn.preBind = function(type, data, fn) {
var currentBindings = this.data('events')[type];
var currentBindingsLastIndex = currentBindings.length - 1;
var newBindings = [];
// bind the event
this.bind(type, data, fn);
// move the new event to the top of the array
newBindings.push(currentBindings[currentBindingsLastIndex]);
@derhasi
derhasi / build.sh
Created April 23, 2015 09:32
A build script for creating a build branch with all composer dependencies. Needs https://github.com/derhasi/staging
#!/usr/bin/env bash
########################################################################################################################
#
# BUILD SCRIPT
#
# Currently the build is triggered from the current branch!
#
# The build script builds a new branch from the current branch by installing all dependencies and allowing those
# dependencies to be checked in with using .build.gitignore.
@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active June 23, 2024 21:12
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@chx
chx / services-grep
Last active September 11, 2017 18:21
services-grep
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' $2 | \
jq -Mr --arg name "$1" '.services | keys[] as $k | .[$k] | select(.tags[]?.name == $name) | $k'
# ag -l -G '.services.yml$' access_check| while read filename ;do services-grep access_check "$filename" ;done