It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
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
var get = Ember.get, set = Ember.set, doc = document; | |
var FastSelectComponent = Ember.Component.extend({ | |
items: null, | |
valuePath: 'value', | |
labelPath: 'label', | |
value: null, | |
selected: null, | |
tagName: 'select', |
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 'rubygems' | |
require 'sinatra' | |
require 'json' | |
class GitHubUpdater | |
def self.update?(json) | |
(JSON.parse(json)["ref"] == "refs/heads/master") | |
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 'execjs' | |
class HandlebarsFilter < Filter | |
class << self | |
def contents | |
@@contents ||= [File.read("headless-ember.js"), File.read("ember.js")].join("\n") | |
end | |
def context | |
@@context ||= ExecJS.compile(contents) |
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 integer? | |
ActivePattern::Pattern.build do |value, pass| | |
if value.is_a? Integer | |
value | |
elsif value.is_a? String | |
/\A[-+]?\d+\z/ === value ? value.to_i : pass | |
else | |
pass | |
end | |
end |