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
{-# Language CPP #-} | |
{-# Language BlockArguments #-} | |
{-# Language GADTs #-} | |
{-# Language RankNTypes #-} | |
{-# Language ViewPatterns #-} | |
{-# Language TypeApplications #-} | |
{-# Language BangPatterns #-} | |
{-# Language TypeOperators #-} | |
{-# Language TypeFamilyDependencies #-} | |
{-# Language DataKinds #-} |
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
#!/usr/bin/env python3 | |
"""Parses and encodes the result of `docker ps` in JSON format.""" | |
import json | |
import sys | |
from collections import namedtuple | |
from subprocess import Popen, PIPE | |
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
#!/usr/bin/env ruby-head | |
class VeryBasicObject < BasicObject | |
undef :== | |
undef :!= | |
undef :! | |
end | |
class Captured < VeryBasicObject | |
def method_missing meth, *args |
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
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| FUCKIN PUSSIES | |
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
13:16 <luite> | hello | |
13:16 <ChongLi> | somebody has a mental illness! | |
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| compelled to write Node.js! | |
13:16 <genisage> | hi | |
13:16 <luite> | you might be pleased to learn that you can compile | |
| haskell to javascript now |
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
# asking() @ https://gist.github.com/np/5107721#file-asking-sh {{{ | |
# Dependencies: | |
# error() @ https://gist.github.com/np/3736727#file-error-sh | |
# Options: | |
# --default=no Makes No being the default (--default=yes is the default) | |
# --no-slmenu Do no use slmenu even if available | |
# Examples: | |
# asking 'Something failed, do you still want to continue?' | |
# asking --default=yes 'Next step?' | |
asking(){ |
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
# error() @ https://gist.github.com/np/3736727#file-error-sh {{{ | |
# Takes an exit code and a message, prints the message and then exits | |
error(){ | |
local code="$1" | |
shift | |
echo "error: $@" >>/dev/stderr | |
exit "$code" | |
} | |
# }}} |
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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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
# link() @ https://gist.github.com/np/3181899#file-link-sh {{{ | |
# Dependencies: | |
# error() @ https://gist.github.com/np/3736727#file-error-sh | |
# Examples: | |
# cd ~/configs | |
# link .zshrc ~/.zshrc | |
# link .vimrc ~/.vimrc | |
link(){ | |
local dst="$1" | |
local ldst="$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
require 'json' | |
# put this file in the same dir as namecoind executable | |
JSON.load(`./namecoind name_list`).each do |domain| | |
if domain['expires_in'] < 5000 | |
command = "./namecoind name_update '#{domain['name']}' '#{domain['value']}'" | |
puts command | |
puts `#{command}` | |
end |