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
/* @flow */ | |
var React = require("react") | |
var Immutable = require("immutable") | |
// In order to use any type as props, including Immutable objects, we | |
// wrap our prop type as the sole "data" key passed as props. | |
type Component<P> = ReactClass<{},{ data: P },{}> | |
type Element = ReactElement<any, any, any> |
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 RackTestHelpers | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def self.define_action(action) | |
define_method action do |*args, &block| | |
options = args.extract_options! | |
options[:http_method] = action | |
options[:controller_method] = args[0] | |
args[0] = [action.to_s.upcase, "#" + options[:controller_method].to_s].join(" ") |
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
index 3ef907960..5de2e0e85 100644 | |
--- a/runtime/compare.c | |
+++ b/runtime/compare.c | |
@@ -133,7 +133,8 @@ static intnat do_compare_val(struct compare_stack* stk, | |
return Long_val(v1) - Long_val(v2); | |
/* Subtraction above cannot overflow and cannot result in UNORDERED */ | |
#ifndef NO_NAKED_POINTERS | |
- if (Is_in_value_area(v2)) { | |
+ if (!Is_in_value_area(v2)) | |
+ return LESS; |
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
/* @flow */ | |
type Maybe<T,U> = (pattern: { | |
some(x: T): U; | |
none(): U; | |
}) => U; | |
function map<A,B,C>(maybe: Maybe<A,C>, f: (a: A) => B): Maybe<B,C> { | |
return function(pattern) { | |
return maybe({ |
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 |
NewerOlder