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
def override_class_method(klass, meth) | |
# FIXME: This is somehow ugly. We should reduce the amount of | |
# `evaled` code. | |
str = " class << #{klass} | |
original = '#{meth}'.to_sym | |
saved_meth_name = '#{get_saved_method_name(meth)}'.to_sym | |
new_method = '#{meth}_modified'.to_sym | |
alias_method saved_meth_name, original |
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
<!doctype html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title></title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
# Makefile to create new CA and application keys more easily | |
have_cnf:=$(wildcard server.cnf) | |
have_cacnf:=$(wildcard ca.cnf) | |
all: server.key.nopass server.crt | |
serve: | |
openssl s_server |
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 | |
require 'csv' | |
puts CSV.parse(DATA).inspect | |
__END__ | |
"hi","there" |
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/sh | |
string="these are:some words" | |
for i in $string; do | |
echo "i: $i" | |
done | |
IFS=":" | |
for j in $string; do |
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 | |
f = lambda x: ( x + | |
1) | |
print f(123) |
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 | |
f = lambda x: \ | |
x + 1 | |
print f(123) |
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 | |
def fn(arg, other = arg.to_s) | |
puts other.inspect | |
end | |
fn(6) | |
fn(7, [1, 2]) |
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 | |
def fn(arg, other = arg.to_s) | |
puts other.inspect | |
end | |
fn(6) | |
fn(7, [1, 2]) |
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 | |
class Butts | |
def foo | |
a = 1 | |
a += 42 | |
puts "hi #{a}" | |
end | |
end | |
puts RubyVM::InstructionSequence.disasm(Butts.new.method(:foo)) |