This file contains 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
# example class / prototype to test on the client | |
class ClientThing | |
clientFoo: -> | |
Meteor.call 'serverFoo', 'bar' | |
# client-side test | |
describe 'ClientThing', -> | |
clientThing = new ClientThing() | |
describe '#clientFoo', -> | |
it 'calls serverFoo with "bar"', (test) -> |
This file contains 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
package main | |
import "fmt" | |
type poolJSON struct { | |
Clusters []clusterJSON `json:"clusters"` | |
} | |
type clusterJSON struct { | |
InstanceID string `json:"instance_id"` |
This file contains 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
# returns a random operation that | |
# result in n. eg: | |
# randomOperation(20) => [4, '*', 5] | |
# randomOperation(10) => [20, '/', 2] | |
class RandomOperationGenerator | |
def initialize(min = 0, max = 20) | |
raise "min must be less than max" unless min < max | |
@min = min | |
@max = max | |
end |
This file contains 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
package main | |
import "fmt" | |
func binarySearchRec(elem int, array []int, accesses int) (bool, int) { | |
accesses += 1 | |
if len(array) == 0 { | |
return false, accesses | |
} else if len(array) == 1 { |
This file has been truncated, but you can view the full file.
This file contains 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
3M,MMM,2012-12-21 11:23:00 UTC,20 | |
3M,MMM,2012-12-21 11:18:00 UTC,35 | |
3M,MMM,2012-12-11 04:42:00 UTC,2 | |
3M,MMM,2012-12-09 10:59:00 UTC,15 | |
3M,MMM,2012-11-08 14:15:00 UTC,15 | |
3M,MMM,2012-11-05 20:35:00 UTC,154 | |
3M,MMM,2012-10-29 11:22:00 UTC,33 | |
3M,MMM,2012-10-24 05:18:00 UTC,4 | |
3M,MMM,2012-10-08 10:26:00 UTC,24 | |
3M,MMM,2012-10-08 10:26:00 UTC,24 |
This file contains 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
# | |
# Extensions to Enumerable to add more functional operators | |
# More info here: http://ukoki.com/post/38615453403/extending-rubys-enumerable | |
# | |
module Enumerable | |
# example: | |
# [1,2,3].zip_map([1,2,3], [1,2,3]) { |x,y,z| x * y * z } | |
# => [1,8,27] |
NewerOlder