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
o = | |
a: 'foo' | |
b: 'bar' | |
p = map o, (val, key) -> | |
object [[k,v]] |
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
isFn = (fn) -> typeof fn is 'function' | |
multiMap = (coll, [fn, fns...]...) -> | |
return coll unless isFn fn | |
multiMap map(coll, fn), fns... | |
# Usage: | |
# multiMap myCollection, fn1, fn2, fn3 |
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
#!/bin/bash | |
# Diff the headers and response body of two different urls with curl | |
NAME=`basename $0` | |
COMMAND="diff <(curl -is '$1') <(curl -is '$2')" | |
if [ $# -ne 2 ] | |
then | |
echo "Usage: $NAME <http://foobar.com> <http://bazqux.com>" 1>&2 | |
exit 1 |
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
import scala.scalanative.native | |
import native._ | |
@native.link("curl") | |
@native.extern object curl { | |
import CurlTypes._ | |
@native.name("curl_global_init") | |
def globalInit(flags: native.CLong): native.Ptr[Byte] = native.extern |
OlderNewer