Skip to content

Instantly share code, notes, and snippets.

View catwell's full-sized avatar

Pierre Chapuis catwell

View GitHub Profile
@jjaffeux
jjaffeux / books.txt
Created August 29, 2012 13:23
books
Exceptional Ruby (Avdi Grimm)
Objects on Rail (Avdi Grimm)
Confident Ruby (Avdi Grimm)
Eloquent Ruby (Russ Olsen)
Growing Object-Oriented Software Guided by Tests (Steve Freeman and Nat Pryce)
Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Jez Humble and David Farley)
Clean Code (Robert C. Martin)
Working with UNIX processes (Jesse Storimer)
Working With TCP Sockets (Jesse Storimer)
Founders at Work (Livingston)
@catwell
catwell / active.md
Last active December 21, 2023 09:47
Speakerdecks
@deltheil
deltheil / nginx.conf
Created June 4, 2012 07:57
Hide sensitive GET parameters within nginx access logs thanks to the Lua module
http {
log_format filt '$remote_addr - $remote_user [$time_local] "$_request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
location /login {
# `set` is provided by the Rewrite module
set $filter "password|secret";
@malkia
malkia / cdef-sample.lua
Created January 12, 2012 20:23
idea: extend luajit's ffi.cdef so that it can return introspection information
-- Something like (ZeroMQ in this case)
return {
typedefs = {
functions = {
zmq_free_fn = { "void", "data", "hint" },
},
structs = {
zmq_pollitem_t = "zmq_pollitem_t"
},
require 'rubygems'
require 'json'
require 'redis'
class RedisComments
def initialize(redis,namespace,sort_proc=nil)
@r = redis
@namespace = namespace
@sort_proc = sort_proc
end
@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end