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
declare module "jsverify" { | |
// Either | |
declare interface Either<A,B> { | |
either<T>(l: (a: A) => T, r: (b: B) => T): T; | |
isEqual(other: Either<A,B>): boolean; | |
bimap<C,D>(f: (a: A) => C, g: (b: B) => D): Either<C,D>; | |
first<C>(f: (a: A) => C): Either<C,B>; | |
second<D>(g: (b: B) => D): Either<A,D>; |
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 Maybe2<T,U> = (pattern: { | |
some: (x: T) => U, | |
none: () => U | |
}) => U; | |
type Maybe<T> = Maybe2<T, *>; | |
// Constructors |
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: -> |
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
x = "some file name.with dots.html.markdown" | |
x.split(".").reverse.inject([x, []]) do |(file, exts), part| | |
if part =~ /\s/ || part == file | |
break [file, exts] | |
else | |
[file.chomp(".#{part}"), exts.push(part)] | |
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
var http = require("http"); | |
var port = process.env.PORT || 8000; | |
var listeners = []; | |
function server(request, response) { | |
switch (request.method) { | |
case "GET": | |
listen(request, response); |
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
1) HTTPSpec::Clients::CGI issues requests to the app | |
69 Failure/Error: Unable to find matching line from backtrace | |
70 Java::JavaLang::NullPointerException: | |
71 # org.jruby.util.ShellLauncher.getCurrentEnv(ShellLauncher.java:235) | |
72 # org.jruby.util.ShellLauncher.popenShared(ShellLauncher.java:712) | |
73 # org.jruby.util.ShellLauncher.popenShared(ShellLauncher.java:689) | |
74 # org.jruby.util.ShellLauncher.popen(ShellLauncher.java:673) | |
75 # org.jruby.RubyIO.popen19(RubyIO.java:3722) | |
76 # org.jruby.RubyIO$s$0$1$popen19.call(RubyIO$s$0$1$popen19.gen:65535) | |
77 # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:219) |
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 "rack" | |
require "capybara/rspec" | |
App = Rack::Builder.new do | |
map "/" do | |
run proc { |env| | |
request = Rack::Request.new(env) | |
response = Rack::Response.new | |
if request.cookies["logged_in"] | |
response.write "Logged in!" |
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 "httparty" | |
class FacebookTestUser | |
include HTTParty | |
base_uri "graph.facebook.com:443" | |
attr_reader :email, :password | |
def initialize(options) | |
@email = options["email"] |