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 Thing implements IThing { | |
constructor(private name: string) { } | |
public doStuff(): string { | |
return "hello"; | |
} | |
} | |
interface IThing { | |
doStuff(): string |
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
quine.rb:1: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END | |
quine.rb:1: syntax error, unexpected tI... | |
^ |
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
[0, -30, 30, 0, -30, 30, 0, -30, 30, 0] | |
[0, -30, 30, 0, -30, 30, 0, -30, 30, 0] | |
[0, -30, 30, 0, -30, 30, 0, -30, 30, 0] | |
user system total real | |
eager_map 0.400000 0.010000 0.410000 ( 0.413597) | |
lazy_map 1.640000 0.000000 1.640000 ( 1.642215) | |
composed 0.610000 0.000000 0.610000 ( 0.610857) | |
m_composed 0.140000 0.000000 0.140000 ( 0.136136) |
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
function mapComp(array, fn) { | |
var result = []; | |
for(var i = 0; i < array.length; i++) { | |
result.push(fn(i)); | |
} | |
return result; | |
} |
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
# OSX for Hackers (Mavericks/Yosemite) | |
# | |
# Source: https://gist.github.com/brandonb927/3195465 | |
#!/bin/sh | |
# Some things taken from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Ask for the administrator password upfront |
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
<html> | |
<body> | |
<div style="color:white"> | |
<a>foo</a> | |
</div> | |
</body> | |
</html> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#mongo 2.4 running with --auth | |
require 'mongo' | |
require 'json' | |
client = Mongo::MongoClient.new('localhost', 27017) | |
admin = { user: 'admin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'clusterAdmin'] } | |
user = { user: 'app', pwd: 'password', roles: ['readWrite'] } |
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
module James | |
open System | |
let strToInt str = | |
try | |
Some (Int32.Parse(str)) | |
with | |
| _ -> None |
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
module james | |
let rec fib = function | |
| 0 -> 0 | |
| 1 -> 1 | |
| n -> fib(n - 1) + fib(n - 2) | |
type Thing = | |
| Something = 1 |