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 http = require('http'); | |
var steamUidRe = /<steamID64>(.*)<\/steamID64>/; | |
function getSteamUid(username, callback) { | |
var callbackCalled = false; | |
var req = http.request({ | |
host: 'steamcommunity.com', | |
port: 80, |
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
// Why does this code sample hang client | |
// connections if ASYNC === true? | |
// | |
// # Start server | |
// node test.js --sync port | |
// node test.js --async port | |
// | |
// # Test | |
// curl http://host:port/ |
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
/* before */ | |
#wrapper #content .post .copy { | |
color: #6e7173; | |
padding: 10px; | |
font-size: 13px; | |
line-height: 15px; | |
} | |
/* after */ | |
#wrapper #content .post .copy { |
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
// AS3 Dictionary replacement | |
// | |
// Patterns to replace: | |
// | |
// import flash.utils.Dictionary; | |
// => import io.spaceport.util.Dictionary; | |
// | |
// var dict:Dictionary; | |
// => var dict:Map; | |
// |
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
-- ghc -Wall -Werror -O2 test_java.hs -o test_java.exe && strip test_java.exe | |
import Control.Applicative | |
import Control.Monad (guard) | |
import Data.Bits | |
import Data.List (nub) | |
import Data.Maybe (catMaybes) | |
import System.Exit | |
import System.FilePath | |
import System.IO |
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
def concat ([[a]] -> [a]): (a)[] ([a] [a] -> [a]){ + } foldDown | |
def ; ([a] a -> [a]): push | |
def show_board_cell (Char -> Char){ } | |
def cell_number_to_index (Int -> Int): | |
8 __swap - | |
def show_board_cell_at ([Char] Int -> Char): |
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
$ cabal-dev build | |
Building b-0.1.0.0... | |
Preprocessing library b-0.1.0.0... | |
[14 of 14] Compiling Data.DynSetMR ( Data/DynSetMR.hs, dist/build/Data/DynSetMR.o ) | |
Data/DynSetMR.hs:79:23: | |
My brain just exploded | |
I can't handle pattern bindings for existential or GADT data constructors. | |
Instead, use a case-expression, or do-notation, to unpack the constructor. | |
In the pattern: Dictionary |
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
{-# LANGUAGE ScopedTypeVariables #-} | |
f :: forall a. Int => Int | |
f = undefined |
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
ghci> :hist 1000 | |
-1 : putState (/Users/mg/Projects/b/B/Oracle/InMemory/Pure.hs:(53,1)-(55,43)) | |
-2 : getBuildRuleParallel (/Users/mg/Projects/b/B/Monad.hs:136:10-37) | |
-3 : get:getAnswer (/Users/mg/Projects/b/B/Oracle/InMemory/Pure.hs:(163,3)-(165,23)) | |
-4 : get:getAnswer (/Users/mg/Projects/b/B/Oracle/InMemory/Pure.hs:(163,3)-(165,23)) | |
-5 : get:getAnswer (/Users/mg/Projects/b/B/Oracle/InMemory/Pure.hs:(163,3)-(165,23)) | |
-6 : getBuildRuleParallel (/Users/mg/Projects/b/B/Monad.hs:136:10-37) | |
-7 : == (/Users/mg/Projects/b/B/Oracle/InMemory/Pure.hs:82:7-20) | |
-8 : == (/Users/mg/Projects/b/B/Oracle/InMemory/Pure.hs:82:7-38) | |
-9 : == (/Users/mg/Projects/b/B/Oracle/InMemory/Pure.hs:(82,7)-(83,35)) |
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 tuple(/* ... */) { | |
var args = arguments; | |
return function unpackTuple(f) { | |
return f.apply(this, args); | |
}; | |
} | |
var t = tuple(1, 2, 3); | |
t(function (a, b, c) { |
OlderNewer