View Main.scala
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 |
View diff_url
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 |
View multimap.coffee
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 |
View objects.coffee
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]] |
View index.js
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 bh = require('bulk-hogan'); | |
bh.baseDirectory = 'foo'; | |
var bh2 = { prototype: bh }; | |
console.log(bh.baseDirectory, bh2.baseDirectory); | |
bh2.baseDirectory = 'bar'; |
View curry.coffee
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
partial = (fn, args...) -> | |
(innerArgs...) -> | |
args = args.concat(innerArgs) | |
fn(args...) | |
curry = (fn, arity = fn.length) -> | |
(args...) -> | |
innerFn = (arity) -> | |
if arity > 0 | |
curry partial(fn, args...), arity |
View .ackrc
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
--noheading | |
--ignore-dir=public/assets | |
--ignore-dir=public/javascripts/cache | |
--ignore-dir=db | |
--ignore-dir=log | |
--type-add=js=.mustache | |
--type-set=coffee=.coffee,.cakefile | |
--type-set=tests=.spec,.feature,.rb | |
--type-set=ruby=.rb,.rhtml,.rjs,.rxml,.erb,.rake,.haml,.mustache | |
--type-set=mustache=.mustache |
View git-fresh
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 | |
# ## git-fresh | |
# | |
# Author: Tristan Blease <tristan@bleaseinteractive.com> | |
# Website: tristanblease.com | |
# License: http://www.opensource.org/licenses/MIT | |
# | |
# Quick shell script to check the freshness of your git repository branches | |
# |
View gist:2704924
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
# Taken from http://william.shallum.net/random-notes/automatically-start-tmux-on-ssh-login | |
if [ "$PS1" != "" -a "${STARTED_TMUX:-x}" = x -a "${SSH_TTY:-x}" != x ] | |
then | |
STARTED_TMUX=1; export STARTED_TMUX | |
sleep 1 | |
( (tmux has-session -t remote && tmux attach-session -t remote) || (tmux new-session -s remote) ) && exit 0 | |
echo "tmux failed to start" | |
fi |
View gist:1936640
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
{!-- Looping and splitting entries --} | |
{exp:channel:entries channel="foo"} | |
{if count == 1} | |
<ul> | |
{/if} | |
<li>{bar}</li> | |
{if count == total_results} |
NewerOlder