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
require 'digest' | |
require 'fileutils' | |
EXCLUDES = %w{.rb .md} | |
def exclude?(path) | |
EXCLUDES.any? {|pattern| path.end_with? pattern } | |
end | |
def md5_name(path) |
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
const groupByKey = R.compose( | |
R.groupBy(R.head), | |
R.apply(R.concat), | |
R.map(R.toPairs) | |
) |
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
-module(levenshtein). | |
-export([distance/2]). | |
store_result(Key, Value, Cache) -> | |
{Value, dict:store(Key, Value, Cache)}. | |
distance(String1, String2) -> | |
{List,_} = distance(String1, String2, dict:new()), | |
List. |
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
-module(levenshtein). | |
-export([distance/2]). | |
first_letter_check(OneLetter, TwoLetter) -> | |
if OneLetter =:= TwoLetter -> 0 | |
; true -> 1 | |
end. | |
distance(String1, String1) -> 0; | |
distance(String, "") -> string:len(String); |
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
require 'rspec' | |
def meth1(order, &block) | |
order << 1 | |
block.call order if block_given? | |
order | |
end | |
def meth2(order, &block) | |
order << 2 |
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
Mode LastWriteTime Length Name | |
---- ------------- ------ ---- | |
----- 1/7/2014 11:34 AM 103424 Antlr3.Runtime.dll | |
----- 1/7/2014 11:34 AM 435712 Antlr3.Runtime.pdb | |
----- 1/7/2014 11:34 AM 56320 AspNet.WebApi.HtmlMicrodataFormatter.dll | |
----- 1/7/2014 11:34 AM 39424 Common.Logging.dll | |
----- 1/7/2014 11:34 AM 14336 Common.Logging.Log4Net1211.dll | |
----- 1/7/2014 11:34 AM 34304 Common.Logging.Log4Net1211.pdb | |
----- 1/7/2014 11:34 AM 14100 Common.Logging.Log4Net1211.xml | |
----- 1/7/2014 11:34 AM 142848 Common.Logging.pdb |
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
16:48:56 sidekiq.1 | 2013-12-06T21:48:56Z 26781 TID-owwutrfec RebuildCache JID-8c0f5e76547cd8f47c07d423 INFO: start | |
16:49:05 sidekiq.1 | [deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message. | |
16:49:54 web.1 | Thin web server (v1.6.1 codename Death Proof) | |
16:49:54 web.1 | Maximum connections set to 1024 | |
16:49:54 web.1 | Listening on 0.0.0.0:9393, CTRL+C to stop | |
16:49:54 web.1 | 2013-12-06T21:48:56Z 26780 TID-ovwg76bik INFO: Sidekiq client with redis options {:url=>"redis://localhost:6379", :namespace=>"TrainWreck"} | |
17:00:00 sidekiq.1 | 2013-12-06T22:00:00Z 26781 TID-owwut0mtc INFO: [Sidetiq] Enqueue: UpdateCache (at: 1386369000.0) (last: -1.0) |
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
class Collection | |
constructor: (items) -> | |
@all = if _.any(items, (item) => item instanceof @modelType) | |
items | |
else | |
(new @modelType(item) for item in items) | |
add: (item) -> | |
@all.push(item) |
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
class Tokenize; end | |
class CountWords; end | |
class TotalSum; end | |
class MovingAverage; end | |
class Class | |
def |(other_class) | |
{self => other_class} | |
end | |
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
require 'spec_helper' | |
require 'branch_cache' | |
require 'changeset_cache' | |
shared_examples "cached data" do | |
Given(:cache) { described_class.new } | |
context "can store and retreive changeset data by branch as a set" do | |
Given(:changeset_data) { %w(data fake some) } | |
When { cache.store("Big Branch", data) } |