Skip to content

Instantly share code, notes, and snippets.

View richo's full-sized avatar

richö butts richo

View GitHub Profile
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
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title></title>
</head>
<body>
</body>
</html>
# 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
#!/usr/bin/env ruby
require 'csv'
puts CSV.parse(DATA).inspect
__END__
"hi","there"
#!/bin/sh
string="these are:some words"
for i in $string; do
echo "i: $i"
done
IFS=":"
for j in $string; do
#!/usr/bin/env python
f = lambda x: ( x +
1)
print f(123)
#!/usr/bin/env python
f = lambda x: \
x + 1
print f(123)
#!/usr/bin/env ruby
def fn(arg, other = arg.to_s)
puts other.inspect
end
fn(6)
fn(7, [1, 2])
#!/usr/bin/env ruby
def fn(arg, other = arg.to_s)
puts other.inspect
end
fn(6)
fn(7, [1, 2])
#!/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))