Skip to content

Instantly share code, notes, and snippets.

/*!
* jQuery Tiny Pub/Sub - v0.6 - 1/10/2011
* http://benalman.com/ see https://gist.github.com/661855
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*
* (removed pre 1.4.3 support, added $.pubsubdebug())
*/
@isao
isao / LICENSE.txt
Created October 19, 2011 05:13 — forked from tomkp/LICENSE.txt
140byt.es -- sparklines!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@isao
isao / jquery.ba-tinypubsub.js
Created December 16, 2011 17:57 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@isao
isao / brew-services.rb
Created January 31, 2012 05:45 — forked from lwe/brew-services.rb
External script for homebrew to simplify starting services via launchctl, out of the box support for any formula which implements #startup_plist.
#!/usr/bin/env ruby -w
# brew-services(1) - Easily start and stop formulas via launchctl
# ===============================================================
#
# ## SYNOPSIS
#
# [<sudo>] `brew services` `list`<br>
# [<sudo>] `brew services` `restart` <formula><br>
# [<sudo>] `brew services` `start` <formula> [<plist>]<br>
@isao
isao / jquery.commafy.js
Created March 9, 2012 06:14 — forked from mahalie/jquery.commafy.js
jQuery commafy
/* COMMAFY
* Simple helper function to add commas to any number
* Requires jQuery, via @cowboy
*/
function commafy(n) {
var n = n || 0;
n = (n+'').split('.').map(function(s,i){return i?s:s.replace(/(\d)(?=(?:\d{3})+$)/g,'$1,')}).join('.');
return n;
}
@isao
isao / gist:2513213
Created April 27, 2012 21:03
closure
#!/usr/bin/env node
var i = 0,
n = 10,
times = {},
http = require('http');
for(; i < n; i++) {
reqone(i + 1);
}
@isao
isao / git-pullrequest.sh
Created June 6, 2012 17:57 — forked from CyberShadow/git-pullrequest.sh
Easy GitHub pull requests
#!/bin/bash -e
# based on Vladimir Panteleev's https://gist.github.com/1885859
die() {
echo "$@" >&2
exit 1
}
branch=$(git name-rev --name-only HEAD 2>/dev/null)
ghusr=$(git config --get github.user)
@isao
isao / pre-commit
Created June 6, 2012 18:29
put this in path/to/mojito/.git/hooks to run jslint before every commit
#!/bin/sh
# run jslint before every commit
# to install, cp to path/to/mojito/.git/hooks/pre-commit && chmod +x !$
./source/bin/mojito jslint
@isao
isao / pre-commit.sh
Created June 12, 2012 00:50
mojito jslint via git pre-commit hook
#!/bin/sh
# run jslint before every commit
# install: copy this in path/to/mojito/.git/hooks/pre-commit, chmod +x !$
./source/bin/mojito jslint
# for unit tests..
#./source/bin/mojito test app .
#./source/bin/mojito test mojit mojits/..
@isao
isao / gitio
Created June 20, 2012 05:30 — forked from defunkt/gitio
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]