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 'redis' | |
require 'json' | |
require 'celluloid' | |
require 'celluloid/io' | |
class RedisAdapter | |
include Celluloid | |
def initialize(redis) | |
@redis = redis |
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 Hash | |
def symbolize_keys | |
inject({}) do |options, (key, value)| | |
options[(key.to_sym rescue key) || key] = value | |
options | |
end | |
end | |
def symbolize_keys! | |
self.replace(self.symbolize_keys) |
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
/* | |
This document has been created with Marked.app <http://markedapp.com>, Copyright 2011 Brett Terpstra | |
Please leave this notice in place, along with any additional credits below. | |
--------------------------------------------------------------- | |
Upstanding Citizen by Brett Terpstra | |
Non-standard fonts used: | |
* OSPDIN | |
* League Gothic | |
* Fjord | |
* Inconsolata |
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
data:text/html, <html><style> body { font-family: PragmataPro }</style><body contenteditable> |
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 Finder | |
def self.find(query) | |
people = [] | |
conditions = [] | |
words = query.split(' ') | |
case words.count | |
when 1 | |
conditions << ["id = ?", query] |
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
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html | |
# https://www.varnish-cache.org/trac/wiki/VCLExamples | |
# Summary | |
# 1. Varnish will poll the backend at /health_check to make sure it is | |
# healthy. If the backend goes down, varnish will server stale content | |
# from the cache for up to 1 hour. | |
# 2. Varnish will pass X-Forwarded-For headers through to the backend | |
# 3. Varnish will remove cookies from urls that match static content file | |
# extensions (jpg, gif, ...) |
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
# change foo to your library name | |
# change Foo::Database to your Sequel database | |
namespace :bundler do | |
task :setup do | |
require 'rubygems' | |
require 'bundler/setup' | |
end | |
end |
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
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | |
tar -xf vim-7.3.tar.bz2 | |
cd vim73 | |
./configure --prefix=/usr/local --without-x --disable-nls --with-tlib=ncurses --enable-multibyte --enable-rubyinterp --enable-pythoninterp --with-features=huge --enable-gui=gnome2 | |
make | |
sudo make install | |
sudo ln -f /usr/local/bin/vim /usr/local/bin/vi |
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
; | |
; My Own HTTP Daemon | |
; A web server for i386 Linux because I was bored | |
; Copyright (C) 2012 Neill Corlett | |
; | |
; This program is free software: you can redistribute it and/or modify it under | |
; the terms of the GNU General Public License as published by the Free Software | |
; Foundation, either version 3 of the License, or (at your option) any later | |
; version. | |
; |
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
user jessed staff; | |
worker_processes 2; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |