Skip to content

Instantly share code, notes, and snippets.

View freshtonic's full-sized avatar
🎯

James Sadler freshtonic

🎯
  • Sydney, Australia
View GitHub Profile
# foo.coffee
kiwi: require('kiwi')
kiwi.require('ext') # The magic line. Commented-out everything works as it should; left in you get an exception (see below)
require('./bar')
# bar.coffee
sys: require('sys')
W: node: copyright-lists-upstream-authors-with-dh_make-boilerplate
W: node: copyright-has-url-from-dh_make-boilerplate
W: node: copyright-contains-dh_make-todo-boilerplate
E: node: description-starts-with-package-name
W: node: description-starts-with-leading-spaces
W: node: new-package-should-close-itp-bug
http://github.com/creationix/step
http://github.com/creationix/do
http://github.com/creationix/conductor
http://github.com/kriszyp/node-promise
http://github.com/weaver/begin.js
#!/usr/bin/env ruby
require 'trollop'
require 'em-http'
require 'sha1'
require 'ruby-debug'
# Event driven Dynamo Server Benchmarker
class DynamoBenchmarker
class Animal
move: (meters) ->
alert @name + " moved " + meters + "m."
class Snake extends Animal
constructor: (name) ->
@name: name
animal: new Snake("Slithery")
animal.move(30)
class Foo
constructor: (id) ->
@id: id
instanceMethod: ->
alert("instanceMethod was called on instance ${@id}")
f1: new Foo("toot")
f2: new Foo("woot")
# The Ruby version
VBUCKET_COUNT = 4096
def keyToVBucket(key)
b = 27183
a = 31415
vbucket = 0
(0...key.length).each do |i|
vbucket = (a * vbucket + key[i]) % VBUCKET_COUNT
# See what a 'refactored' page looked like before you fucked it up
In your Rails/Sinatra/Whatever app when running in your development environment, expose a 'commit' parameter.
If that parameter is present, have your app serve the view as it was at that commit. E.G. http://localhost:3000/session/new&_commit=HEAD^.
You'll need to intercept whatever you need to in order to determine the file to render (dependent on framework), but ultimately you just need a call to Git like this to make it work:
`git show #{params['_commit']}:#{path_to_view} > #{tmp_file}`
Hi all,
This Saturday 22nd Jan from 1pm until whenever you are invited to join me for some informal drinks and/or food at The Welcome Hotel, 91 Evans Street, Balmain.
I have reserved a couple of tables in the beer garden at the back. It would be great to catch up with everyone before Kel and I embark on our big trip - we're going to be out of the country for about a year... exciting!
Obligatory Google Maps link:
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=the+welcome+hotel,+balmain&aq=&sll=37.0625,-95.677068&sspn=45.553578,93.076172&ie=UTF8&hq=the+welcome+hotel,+balmain&hnear=&radius=15000&ll=-33.86279,151.173506&spn=0.046897,0.090895&z=14
@freshtonic
freshtonic / gist:1180160
Created August 30, 2011 04:06
rubygems bullshit
gem list | grep rake
rake (0.9.2, 0.8.7)
jamessadler@elnido~ ruby-1.8.7-p352@wf (WSF-2495$+90)
⚡ gem uninstall rake --version=0.9.2
You have requested to uninstall the gem:
rake-0.9.2
uuidtools-2.1.1 depends on [rake (>= 0.8.3)]
rack-1.3.2 depends on [rake (>= 0)]
launchy-0.3.7 depends on [rake (>= 0.8.1)]