This file contains hidden or 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
| CREATE TABLE availability ( | |
| dates tstzrange NOT NULL | |
| ); | |
| CREATE TABLE reservation ( | |
| dates tstzrange NOT NULL | |
| ); | |
| COPY availability (dates) FROM stdin; | |
| ["2014-01-01 00:00:00+01","2014-01-10 00:00:00+01"] |
This file contains hidden or 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
| console.log("\033[39mRunning tests…"); | |
| function assertEquals(actual, expected, description) { | |
| if(typeof(actual) === "undefined") { | |
| console.error("\033[31m" + description + " not implemented\033[39m"); | |
| } else { | |
| if(actual !== expected) { | |
| console.error("\033[31m" + description + " failed, expected " + expected + ", got " + actual + "\033[39m"); | |
| } else { | |
| console.log(description + " \033[32m ok\033[39m"); | |
| } |
This file contains hidden or 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
| console.log("\033[39mRunning tests…"); | |
| function assertEquals(actual, expected, description) { | |
| if(typeof actual === "undefined") { | |
| console.error("\033[31m" + description + " not implemented\033[39m"); | |
| } else { | |
| if(actual !== expected) { | |
| console.error("\033[31m" + description + " failed, expected " + expected + ", got " + actual + "\033[39m"); | |
| } else { | |
| console.log(description + " \033[32m ok\033[39m"); | |
| } |
This file contains hidden or 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
| just value = Cont ($ value) | |
| nothing def = Cont (const def) | |
| result = do | |
| x <- just 5 | |
| just (x + 5) | |
| result' = do | |
| x <- nothing(0) | |
| just (x + 5) |
This file contains hidden or 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 play.api.Play.current | |
| import scala.concurrent.duration._ | |
| import play.api.libs.concurrent.Akka | |
| import play.api.libs.concurrent.Execution.Implicits._ | |
| import play.api.Logger | |
| import play.api.libs.mailer._ | |
| object email { | |
| val senderAddress = ("name", "email@example.com") |
This file contains hidden or 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
| package models | |
| import scalaz._ | |
| import Scalaz._ | |
| import anorm._ | |
| import org.postgresql.util.PGobject | |
| import org.postgresql.jdbc4.Jdbc4Array | |
This file contains hidden or 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 A() { | |
| def b(c: C): Unit = () | |
| } | |
| class C() { | |
| def >>:(a: A): Unit = () | |
| } | |
| object test { | |
| val a = new A() |
This file contains hidden or 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 casper = require("casper").create(); | |
| casper.start(); | |
| var screenSize = [1024, 768]; | |
| var frameCount = 68; | |
| function slideUrl(i) { | |
| return 'http://localhost:9000/slides.html#'+i+'.0' | |
| } | |
| function frameName(i) { | |
| var n = i < 10 ? '0' + i : i; |
This file contains hidden or 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 mailjet = require('mailjet'); | |
| var Promise = require('bluebird'); | |
| var _ = require('lodash'); | |
| var request = require('request'); | |
| var Mailjet = function(key, secret) { | |
| return { | |
| makeRequest: function(endPoint, args, method, creds) { | |
| return new Promise(function(resolve, reject) { |
This file contains hidden or 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 m = require('minimist') | |
| undefined | |
| > m(["test.js", "23"]) | |
| { _: [ 'test.js', 23 ] } | |
| > m(["test.js", "23"], { "string": ["_"] }) | |
| { _: [ 'test.js', '23' ] } | |
| > m(["test.js", "--option", "23"], { "string": ["_"] }) | |
| { _: [ 'test.js' ], option: 23 } | |
| > m(["test.js", "--option", "23"], { "string": ["_", "option"] }) | |
| { _: [ 'test.js' ], option: '23' } |