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 | |
$THIS_FILE = File.dirname(File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__) | |
$LOAD_PATH.unshift File.expand_path(File.join($THIS_FILE, '..', 'lib')) | |
require 'greeter' | |
g = Greeter.new | |
g.greet |
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
(function(){ | |
var s = document.createElement('script'); | |
s.setAttribute('src', 'https://code.jquery.com/jquery-latest.min.js'); | |
if (typeof jQuery == 'undefined') { | |
document.getElementsByTagName('head')[0].appendChild(s); | |
} | |
})(); |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG/MacGPG2 v2.0.22 (Darwin) | |
Comment: GPGTools - https://gpgtools.org | |
mQINBFKjG38BEAC7ahP+UblWBW4MqOwjcFy2KdOS+dBkf77KNUCL4K+uFrmr0g8y | |
ux1eiTBvNVQ93p4DQIZJulfAS8AlSBHknVcA7RWLEvPt37g6yA2ppWW26ybEM4B/ | |
ixXYMSNVGWKVJP6ce21GBGX/DtNWcjB7B3VB0y3qN1J+hoDOtd9ODoL2Hcl5tlMJ | |
G3hGK4IbPGIWTIN2YzV/ABondVIvcpn2GkKjcpFivuDubimb75QiwW9C3vF4NMjE | |
73lUm7ongQkZaBrevgGUXIt/LnEI/Dd7NPWrYDYE4HWa3hlfIHUiDNhr9dnsGT2d | |
6cuZY3LqRFBx707KQiW9Hv35R1rL5bkHsl8LiS7W/7TZdgNkyKZfBvcQmYSlW8D+ |
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 'continuation' | |
$__labels__ = {} | |
def label(label) | |
callcc {|cc| $__labels__[label] = cc } | |
end | |
def goto(label) | |
$__labels__[label].call |
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
function gitio { curl -fsi git.io -F "url=$1" | grep 'Location' | sed 's/.*: //' | tee >(pbcopy) } |
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
netstat -anp tcp | awk '$6 ~ "LISTEN" && $4 ~ "22$"' |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
def inspect(s): | |
if s is None: | |
return '"None"' | |
return '"' + str(s) + '"' |
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
class Array | |
def to_proc | |
->(obj) { obj.public_send *self } | |
end | |
end | |
input = <<EOS | |
foo,bar,baz | |
hello,world | |
1,2,3 |
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 'open3' | |
command = 'sh' | |
Open3.popen2e(command) do |stdin, stdout_and_stderr, wait_thread| | |
Thread.new do | |
stdout_and_stderr.each {|l| puts l } | |
end | |
stdin.puts 'ls' |
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
# Inspired by these blog posts: | |
# http://dev.mikamai.com/post/100075543414/elixir-as-a-parsing-tool-writing-a-brainfuck | |
# http://dev.mikamai.com/post/102283561929/elixir-as-a-parsing-tool-writing-a-brainfuck | |
defmodule Brainfuck do | |
@op_decv "-" | |
@op_incv "+" | |
@op_decp "<" | |
@op_incp ">" | |
@op_putc "." |
OlderNewer