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
{ | |
"object": { | |
"groups": [ | |
{ | |
"options": [ | |
{ | |
}, | |
{ | |
} | |
], |
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
#import <Foundation/Foundation.h> | |
#import <libextobjc/EXTConcreteProtocol.h> | |
@protocol Maybe <NSObject> | |
- (id<Maybe>)map:(id (^)(id value))block; | |
- (id<Maybe>)flattenMap:(id<Maybe> (^)(id value))block; | |
- (id<Maybe>)orElse:(id)defaultValue; | |
- (id)getOrElse:(id)defaultValue; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-2.0.2.js"></script> | |
<script src="http://builds.emberjs.com/handlebars-1.0.0.js"></script> | |
<script src="http://builds.emberjs.com/ember-latest.js"></script> | |
</head> | |
<body> | |
<script type="text/x-handlebars" data-template-name="application"> | |
{{view Ember.Select content=options value=computed}} |
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 Foo | |
def self.bar | |
end | |
def bar | |
end | |
end | |
set_trace_func proc { |event, file, line, id, binding, classname| | |
if event == "call" |
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 "active_support/all" | |
now = Date.current | |
# => Thu, 05 Sep 2013 | |
now - 2.months - 5.days + 2.months + 5.days == now | |
# => false | |
now - 2.months - 5.days + 5.days + 2.months == now | |
# => true |
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 "active_record" # 4.0.0.rc2 | |
require "minitest/autorun" | |
class Migrate < ActiveRecord::Migration | |
self.verbose = false | |
def up | |
create_table(:profiles) | |
create_table(:networks) | |
create_table(:memberships) do |t| |
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 "active_record" | |
require "rspec/autorun" | |
class Migrate < ActiveRecord::Migration | |
self.verbose = false | |
def up | |
create_table(:projects) | |
create_table(:tasks) do |t| | |
t.references :project, null: false |
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
(function(){var require = function (file, cwd) { | |
var resolved = require.resolve(file, cwd || '/'); | |
var mod = require.modules[resolved]; | |
if (!mod) throw new Error( | |
'Failed to resolve module ' + file + ', tried ' + resolved | |
); | |
var cached = require.cache[resolved]; | |
var res = cached? cached.exports : mod(); | |
return res; | |
}; |
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
VCR.configure do |config| | |
config.cassette_library_dir = "spec/cassettes" | |
config.hook_into :faraday | |
# If a test uses a value that depends on the current time, then the recording | |
# become stale as time marches on. | |
# This setting will replace specific "absolute time" values with time-relative | |
# keywords when the recording is first made. | |
# On subsequent replayes, the time-relative keywords are substituted with | |
# the appropriate value, so the value is relative tot he current time. |
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 App.Components.Select extends Backbone.View | |
template: HandlebarsTemplates.select | |
initialize: -> | |
@labelField = @options.labelField | |
@valueField = @options.valueField | |
@collection.bind("reset", => @render) | |
render: -> |