This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
constructor: (id) -> | |
@id: id | |
instanceMethod: -> | |
alert("instanceMethod was called on instance ${@id}") | |
f1: new Foo("toot") | |
f2: new Foo("woot") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Animal | |
move: (meters) -> | |
alert @name + " moved " + meters + "m." | |
class Snake extends Animal | |
constructor: (name) -> | |
@name: name | |
animal: new Snake("Slithery") | |
animal.move(30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'trollop' | |
require 'em-http' | |
require 'sha1' | |
require 'ruby-debug' | |
# Event driven Dynamo Server Benchmarker | |
class DynamoBenchmarker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
class Base | |
someMethod: -> | |
sys.puts "hello from Base" | |
class Derived | |
someOtherMethod: -> | |
someMethod() # error: method doesn't exist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%p | |
Blah blah blah blah | |
%a(href='#foo') foo | |
and | |
%a(href='#bar') bar | |
\. | |
-# The problem with the above Haml fragment is that I am left with a space after <a href='#bar'>bar</a> and before the period. | |
-# Haml's whitespace removal does not resolve the issue, because it can either remove ALL whitespace | |
-# around an element or ALL whitespace within an element. Neither option seems to fit the bill. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://skitch.com/railsninja/n4xi5/job-futures | |
Above Url is the interface for the numbers I am trying to pull, Fuck me I have no idea how to try and explain this simply, we have been mindfucking this here for ages | |
1. Is from a table called placement_scores which needs to have numbers from the latest month, period_ending field (date) | |
2. Is also from a table placement_scores but needs to aggregate numbers from the 3 months prior to the latest month | |
3. Is from a table called outcome_scores which needs to aggregate numbers from between 7 months and 5 months prior using a period_ending value as well | |
It looks like 3 separate queries UNIONed together to me, like this: | |
select "Placement targets achieved in #{month_year}", count(*) from placement_scores where .... |