Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# search directory defaults to current
dir=.
# case sensitive search
sensitive=
# colors enabled by default in ttys
if [ -t 1 ]; then
@rauchg
rauchg / RealtimeConf2012.md
Created October 29, 2012 17:24 — forked from dshaw/RealtimeConf2012.md
Realtime Conf 2012 Talks
@rauchg
rauchg / README.md
Created March 16, 2012 21:05
~/.js/github.com.js

github.com.js

dotjs userscript for visualizing package.json files (if present) underneath the tree view.

Very useful for navigating Node.JS projects

#!/usr/bin/env bash
# search directory defaults to current
dir=.
# case sensitive search
sensitive=
# colors enabled by default in ttys
if [ -t 1 ]; then
/**
# eq.js: minimalistic equation evaluator.
eq(str, vars)
Features:
- evaluate variables in the `vars` object
- `str` can use any `Math` function or property: round, ceil, max, E
#wrap .chrome-frame-message-box
background #eee
color #000
text-align center
height 140px
padding-top 16px
border-bottom solid 1px #bdbdbd
.chrome-frame-message
position relative
width 980px
/**
* Triggers a CSS3 keyframe-based animation
*
* @param {String} animation name
* @api public
*/
jQuery.fn.animation = function (name, opts, fn) {
if ('function' == typeof opts) {
@rauchg
rauchg / haproxy
Created August 30, 2011 21:51
node
∞ ~ ab -n 1000 -c 100 http://127.0.0.1:10000/
This is ApacheBench, Version 2.3 <$Revision: 1139530 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@rauchg
rauchg / gist:935664
Created April 21, 2011 22:59
MongoDB replica set initialization
> rs.initiate({_id: "lbdevset", members: [{_id: 0, host: "HOST:28017"}, {_id: 1, host: "HOST:28018"}] })
> rs.addArb("HOST:28019")
@rauchg
rauchg / gist:935661
Created April 21, 2011 22:57
MongoDB makefile
mongodb:
@$(MONGOD) \
--replSet=lbdevset \
--port=28017 \
--logappend \
--logpath="$(PWD)/logs/mongodb.node1.log" \
--dbpath="$(PWD)/data/db/node1" \
--pidfilepath $(PWD)/pids \
--fork \
--rest