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
audio-ping() { | |
ping $* 1>&2 | | |
while read; do say "ping"; done | |
} |
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
#!/usr/bin/env bash | |
set -e | |
convert_to_alac() { | |
flac="$1" | |
aiff="${flac%.*}.aiff" | |
alac="${flac%.*}.m4a" | |
flac -s -d --force-aiff-format -o "$aiff" "$flac" | |
afconvert -f m4af -d alac "$aiff" "$alac" |
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 self.method_missing(name, *args) | |
name | |
end | |
def function(*param_names, &block) | |
klass = Class.new { attr_accessor :this, *param_names } | |
this = TOPLEVEL_BINDING.eval('self') | |
proc do |*params| | |
context = klass.new |
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
// clang++ -std=c++11 -stdlib=libc++ main.cpp | |
#include <thread> | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
template <typename T> class sum { | |
vector<T> &v; | |
T &r; |
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
class App | |
def initialize(settings = {}) | |
@defaults = {:root_path => ".", :type => "text/plain", :file => "index.html"} | |
@defaults.merge(settings) | |
end | |
def call(env) | |
file = env['REQUEST_PATH'] == '/'? @defaults[:file] : env['REQUEST_PATH'] | |
[ | |
200, |
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
# I'm too lazy to load this from a file | |
ciphertext = [79,59,12,2,79,35,8,28,20,2,3,68,8,9,68,45,0,12,9,67,68,4,7,5,23, | |
27,1,21,79,85,78,79,85,71,38,10,71,27,12,2,79,6,2,8,13,9,1,13,9, | |
8,68,19,7,1,71,56,11,21,11,68,6,3,22,2,14,0,30,79,1,31,6,23,19,10, | |
0,73,79,44,2,79,19,6,28,68,16,6,16,15,79,35,8,11,72,71,14,10,3,79, | |
12,2,79,19,6,28,68,32,0,0,73,79,86,71,39,1,71,24,5,20,79,13,9,79, | |
16,15,10,68,5,10,3,14,1,10,14,1,3,71,24,13,19,7,68,32,0,0,73,79, | |
87,71,39,1,71,12,22,2,14,16,2,11,68,2,25,1,21,22,16,15,6,10,0,79, | |
16,15,10,22,2,79,13,20,65,68,41,0,16,15,6,10,0,79,1,31,6,23,19,28, | |
68,19,7,5,19,79,12,2,79,0,14,11,10,64,27,68,10,14,15,2,65,68,83, |
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
#!/usr/bin/env ruby | |
class Sandbox | |
@@call = -> this, method, *args do | |
this.method(method).call(*args) | |
end | |
def self.method_added name | |
super |
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
/* | |
* Compile with: | |
* gcc -g -Wall -pedantic -framework Foundation -framework ScriptingBridge -o objc-test objc-test.c | |
*/ | |
#include <objc/objc-runtime.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
void listClasses() { |
NewerOlder