Skip to content

Instantly share code, notes, and snippets.

View jcsalterego's full-sized avatar

Jerry Chen jcsalterego

View GitHub Profile
#!/bin/bash
CHEF_ROLE=$1
apt-get update;
# install ruby and other pre-requisites
apt-get install -y \
build-essential \
emacs23-nox \
#!/usr/bin/perl -w
# $Id: check_mem.pl 2 2002-02-28 06:42:51Z egalstad $
# Original script stolen from:
# check_mem.pl Copyright (C) 2000 Dan Larsson <dl@tyfon.net>
# hacked by
# Justin Ellison <justin@techadvise.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
#!/bin/bash -x
prereq () {
apt-get update;
# jchen prerequisites
apt-get install -y \
screen \
pv \
lsof \
rsync \
@jcsalterego
jcsalterego / gist:969186
Created May 12, 2011 18:49
Grab all parameters for `defaults write` for Twitter for Mac
$ find /Applications/Twitter.app \
-type f \
-exec strings {} \; \
| awk '/^values.[^ ]+$/ { sub("values.", ""); print }'
FontSize
ShowDevelopMenu
QuoteTweetSyntax
ShowFullNames
TypeAnywhereToTweet
TMLinkColor
(defun jump-to-other ()
"jumps from lib/ to test/ and vice-versa"
(interactive)
(defconst test-root "/driver/test/driver/")
(defconst lib-root "/driver/lib/project/")
(defun jump-to-lib (path)
"jump to lib from test"
(and (when (string-match test-root path)
(setq path (replace-match lib-root nil nil path)))
(message "jump to lib")
@jcsalterego
jcsalterego / 2.2_and_2.2-scripting.diff
Created May 6, 2011 16:32
Diff btwn redis '2.2' and '2.2-scripting' branches
diff --git a/Makefile b/Makefile
index b72faa1..335f832 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,7 @@ clean:
cd src && $(MAKE) $@
cd deps/hiredis && $(MAKE) $@
cd deps/linenoise && $(MAKE) $@
+ cd deps/lua && $(MAKE) $@
#!/bin/bash
#
############################################################
# BEGIN CONFIG
#
ZIP_CODE=90210
TIMEOUT=600 # seconds
# END CONFIG
@jcsalterego
jcsalterego / twitter-mac.txt
Created January 7, 2011 03:10
All the defaults for Twitter.app
com.twitter.twitter-mac.ESCClosesComposeWindow
com.twitter.twitter-mac.HideInBackground
com.twitter.twitter-mac.ImageServicePreferredServiceDefaultsKey
com.twitter.twitter-mac.LinkColor
com.twitter.twitter-mac.MenuItemBehavior
com.twitter.twitter-mac.NormalComposeWindowLevel
com.twitter.twitter-mac.OpaqueSidebar
com.twitter.twitter-mac.ScrollingMakesKeyAndOrdersFront
com.twitter.twitter-mac.TypeAnywhereToTweet
com.twitter.twitter-mac.UserTimelineDerepeater
#!/bin/sh
#
# Verbose adding of $DOMAIN to searches
#
# Ref: http://www.afp548.com/article.php?story=20050703052052393
DOMAIN='example.org';
DNS='State:/Network/Global/DNS';
echo "
> now = new Date()
"Thu Aug 12 2010 11:24:42 GMT-0500 (CDT)"
> now.getTime()
1281630282255
> db.foo.drop()
true
> db.foo.insert({datetime:now})
> next = new Date(now.getTime() + 1000)
"Thu Aug 12 2010 11:24:43 GMT-0500 (CDT)"
> db.foo.insert({datetime:next})