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
// authentication | |
// client/account specific info | |
// urls | |
// data format transformations; flattening etc | |
// declarative data transform | |
// - flatten | |
// - rename | |
// - convert | |
// - renaming | |
// - blacklist/whitelist |
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
// Paths | |
protocol Path { | |
associatedtype Entity | |
var path: String { get } | |
} | |
protocol ListPath: Path { | |
associatedtype Entity | |
var path: String { get } | |
} |
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
struct Key<T: Storable> { | |
let label: String | |
init(_ label: String) { | |
self.label = label | |
} | |
} | |
protocol Storable {} | |
struct Store { |
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
// http://jsfiddle.net/MrkuK/ | |
// Test version of a stream | |
function Stream(opts) { | |
this._subscribers = []; | |
this.opts = _.extend({ | |
autoDispose: false, | |
valueOnSubscribe: false | |
}, opts); | |
} |
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
(function($) { | |
function Plugin($el, opts) { | |
this.$el = $el; | |
this.settings = $.extend({ | |
// Add default settings here. | |
}, opts); | |
} | |
Plugin.prototype = { |
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
/* -------------------------------------------------------------------------- */ | |
/* DIRTY FORM | |
/* Checks to see if the user has made any changes to a form. Toggles the save | |
/* control on or off appropriately. Also prompts user to save it they attempt | |
/* to navigate away with unsaved changes. | |
/* -------------------------------------------------------------------------- */ | |
(function($) { | |
var DirtyForm = function(form) { | |
this.$form = form; | |
this.$save = form.find('button.save'); |
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
def extract(doc_string) | |
doc = Nokogiri::HTML(doc_string) | |
doc.css('#more-details-content .ed-details-row').map do |r| | |
time = Time.parse(r.at_css('.ed-date p').inner_text.strip) | |
activity = r.at_css('.ed-activity p').inner_text.strip | |
location = r.at_css('.ed-location p').inner_text.strip | |
state = location.match(/\s+(\w{2,3})$/)[1] | |
suburb = location.gsub(state, '').strip |
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
function module(scope, fn) { | |
var result = fn(); | |
if (_.isEmpty(result)) { | |
throw "When defining a module, you _must_ return an object containing exports."; | |
} | |
var split = scope.split('.'); | |
if (split.length > 1) { | |
var parts = _.initial(split, 1), | |
last = _.last(split), |
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
(function(_) { | |
var Inflector = function(config) { | |
}; | |
_.inflect = function(lang) { | |
return new Inflector(_.inflect.langs[lang]); | |
}; |
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
# Install this recipe with: | |
# brew install --HEAD https://gist.github.com/raw/2816905/daafa0d7e3c5da694401fac138aae340a9ead157/elixir.rb | |
require 'formula' | |
class Elixir < Formula | |
homepage 'http://elixir-lang.org/' | |
head 'https://github.com/elixir-lang/elixir.git', :tag => '0.5.0' | |
depends_on 'erlang' |