Skip to content

Instantly share code, notes, and snippets.

@didip
didip / Folder Preferences
Created July 9, 2011 16:16 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@didip
didip / faster-ruby-192.sh
Created July 9, 2011 07:59
Faster Ruby 1.9.2
curl https://raw.github.com/gist/1008945/7532898172cd9f03b4c0d0db145bc2440dcbb2f6/load.patch > /tmp/load.patch
rvm get head # always good to make sure you're up to date with RVM
rvm reload
rvm install ruby-1.9.2-p180 --patch /tmp/load.patch -n patched
rvm use ruby-1.9.2-p180-patched
undefined method `specifications' for "/www/goldstar/tmp/isolate/ruby-1.8":String (NoMethodError)
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:425:in `each_load_path'
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:423:in `each'
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:423:in `each_load_path'
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:587:in `_deprecated_latest_load_paths'
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:586:in `each'
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems.rb:586:in `_deprecated_latest_load_paths'
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:62:in `send'
/Users/didip/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/site_ruby/1.8/rubygems/deprecate.rb:62:in `latest_load_paths'
/www/goldstar/tmp/isolate/ruby-1.8/gems/spork-0.8.5/bin/../lib/spork.rb:112:in `other_spo
@didip
didip / contrib.js
Created May 6, 2011 23:19
Contrib faces
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@didip
didip / gist:959988
Created May 6, 2011 23:18
Contrib face
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'mysql'
at Function._resolveFilename (module.js:299:11)
at Function._load (module.js:245:25)
at require (module.js:327:19)
at Object.<anonymous> (/www/choretastic/mysqltest.js:3:12)
at Module._compile (module.js:383:26)
at Object..js (module.js:389:10)
npm install mysql
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info fetch http://registry.npmjs.org/mysql/-/mysql-0.9.1.tgz
npm info calculating sha1 /var/folders/2w/2wHKL8C9Gvak-rp5FepbE++++TI/-Tmp-/npm-1303316504106/1303316504106-0.5520619999151677/tmp.tgz
npm info shasum 4f240429f60343c9e6cb6717feab072f64ca45d2
npm info calculating sha1 /Users/didip/npm/.npm/.cache/mysql/0.9.1/package.tgz
npm info shasum 33b887a4a3f5e9f4b34d2d83f7cde523bd67241a
npm info preinstall [email protected]
@didip
didip / tornado-static-file.py
Created April 5, 2011 02:49
Tornado StaticFileHandler
class StaticFileHandler(RequestHandler):
"""A simple handler that can serve static content from a directory.
To map a path to this handler for a static data directory /var/www,
you would add a line to your application like:
application = web.Application([
(r"/static/(.*)", web.StaticFileHandler, {"path": "/var/www"}),
])
@didip
didip / unfollow_all_people_i_follow.py
Created March 23, 2011 01:38
Unfollow everyone I follow
#!/usr/bin/python
import twitter
twitter_username = 'you'
twitter_password = 'your_pass'
api = twitter.Api(username=twitter_username, password=twitter_password)
[api.DestroyFriendship(user) for user in api.GetFriends()]
4.722: [GC 4.722: [ParNew: 37279K->3249K(38336K), 0.0178476 secs] 39786K->8088K(1044352K), 0.0179000 secs] [Times: user=0.03 sys=0.01, real=0.02 secs]
Startup execution failed with error.
net.appjet.bodylock.JSRuntimeException: Error: Neither module exists: etherpad.collab.ace.easysync2, etherpad.collab.ace.easysync2.{AttribPool,Changeset}
at net.appjet.bodylock.BodyLock$.unwrapExceptionIfNecessary(bodylock.scala:160)
at net.appjet.bodylock.InnerExecutable.execute(bodylock.scala:80)
at net.appjet.oui.ScopeReuseManager$$anonfun$newRunner$1.apply(servermodel.scala:126)
at net.appjet.oui.ScopeReuseManager$$anonfun$newRunner$1.apply(servermodel.scala:122)
at net.appjet.oui.NoninheritedDynamicVariable.withValue(dynamicvar.scala:38)
at net.appjet.oui.ExecutionContextUtils$.withContext(execution.scala:334)
at net.appjet.oui.ScopeReuseManager$.newRunner(servermodel.scala:122)