var items = files.getLastTwoVersions(filename);
var versions = .then(function(items) {
return [versions.get(items.last),
versions.get(items.previous)];
});
var diff = versions.spread(function(v1, v2) {
return diffService.compare(v1.blob, v2.blob)
});
var result = diff.then(function(diff) {
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 raven = require('raven') | |
, Promise = require('bluebird') | |
, requestAsync = require('request-promise') | |
var redis = Promise.promisifyAll(require('redis').createClient()) | |
var languages = JSON.parse(require('fs').readFileSync(__dirname + '/languages.json')).languages | |
Promise.all(languages.map(function(language){ | |
return redis.setAsync('lang:'+language.tag+':name', language.name) |
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
(flycheck-define-checker purs-check | |
"Use purscheck to flycheck PureScript code." | |
:command ("purscheck" source source-original temporary-file-name) | |
:error-patterns | |
((error line-start | |
(or (and "Error at " (file-name) " line " line ", column " column ":" (zero-or-more " ")) | |
(and "\"" (file-name) "\" (line " line ", column " column "):")) | |
(or (message (one-or-more not-newline)) | |
(and "\n" |
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
// Note: make sure to put an index.html file in the same dir | |
var Promise = require('bluebird'); | |
var fs = require('fs'); | |
var path = require('path'); | |
Promise.promisifyAll(fs); | |
var bl = require('bl'); | |
var baseindex = path.join(__dirname, 'index.html'); |
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 Promise = require('bluebird'); | |
var assert = require('assert'); | |
// Makes a mock transaction | |
function makeTx(tx) { | |
return { | |
query: function(query, params) { | |
console.log("Executed within", tx, ":", query, ", params =", params); | |
return Promise.resolve([query, params]); |
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 t = require('tape'); | |
var parse = require('../parse'); | |
declare function parse(html:string):DOMElement; | |
interface DOMElement { | |
equals(other:DOMElement):boolean; | |
toString():string; | |
name: string; | |
children:Array<DOMElement> |
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 Test where | |
data Matching = Range Number Number | Exact Number | |
match :: Matching -> Matching -> Boolean | |
match (Range min1 max1) (Range min2 max2) = (max1 >= min2) && (max2 >= min1) | |
match (Range min1 max1) (Exact num) = num >= min1 && num <= max1 | |
match (Exact num) (Exact num) = num == num | |
match _ _ = false |
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 Tets where | |
getLine' :: IO [Char] | |
getLine' = getChar >>= \c -> | |
if c == '\n' then | |
return [] | |
else | |
getLine' >>= \cs -> | |
return (c : cs) |
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
// This will produce an error on the last line in TypeScript 0.8.x | |
// $ [sudo] npm install -g typescript@0.8; | |
// $ tsc sealed-interface.ts | |
// TypeScript 0.9 changed this behavior | |
declare class X { public f(a:number):number; } | |
class Y { | |
public f(a: number):number { return a + 1 } | |
public g(a: number):number { return a - 1 } |