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
# Cache Headers | |
# Middleware for configuring HTTP cache policy headers in Rack based web applications. | |
# Apply cache headers to HTTP responses corresponding to requests that match defined | |
# URI patterns. | |
# | |
# Example usage: | |
# | |
# use Rack::CacheHeaders | |
# | |
# Rack::CacheHeaders.configure do |cache| |
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
# twitter.com/michael_jones wrote me | |
# Put in ~/.profile, or similar | |
# Use like "authme someuser@someserver" | |
function authme { | |
ssh $1 'cat >>~/.ssh/authorized_keys' <~/.ssh/id_rsa.pub | |
} |
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
# For "Classic" style/top-level type of apps do something like: | |
# | |
# configure :development do | |
# require File.join(File.dirname(__FILE__), 'sinatra_reloader') | |
# set :reload_paths, [File.join(File.dirname(__FILE__), '**', '*.rb')] | |
# end | |
# | |
# For "Modular" style/Sinatra::Base subclasses: | |
# | |
# configure :development do |
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/perl -w | |
# This software code is made available "AS IS" without warranties of any | |
# kind. You may copy, display, modify and redistribute the software | |
# code either by itself or as incorporated into your code; provided that | |
# you do not remove any proprietary notices. Your use of this software | |
# code is at your own risk and you waive any claim against Amazon | |
# Digital Services, Inc. or its affiliates with respect to your use of | |
# this software code. (c) 2006 Amazon Digital Services, Inc. or its | |
# affiliates. |
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
# Do something like: puts "ROCK".blink.bright.cyan | |
class String | |
def red | |
"\e[31m#{self}\e[0m" | |
end | |
def blue | |
"\e[34m#{self}\e[0m" | |
end |
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
# Earl: Strings that do web things | |
# | |
# | |
# Examples: | |
# | |
# text = "Blah blah http://tinyurl.com/4bnjzbu blah http://tinyurl.com/4tefu9f" | |
# | |
# text.urls # => ["http://tinyurl.com/4bnjzbu", "http://tinyurl.com/4tefu9f"] | |
# | |
# text.locations # => ["http://nutrun.com/weblog/2010/11/17/supercharged-ruby-console-output.html", "http://nutrun.com"] |
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
jobs = [ | |
{:id => :job1, :weight => 3}, | |
{:id => :job2, :weight => 2}, | |
{:id => :job3, :weight => 2}, | |
{:id => :job4, :weight => 4}, | |
{:id => :job5, :weight => 4}, | |
{:id => :job6, :weight => 1} | |
] | |
nodes = [ |
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
# To reproduce, start cap shell and run a command, e.g. `cap> ls' | |
require "thread" | |
Thread.abort_on_exception = true | |
set :application, "foo" | |
role :app, "0.0.0.0" |
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
package main | |
import ( | |
"os" | |
"io" | |
) | |
var fs fileSystem = osFS{} | |
type file interface { |
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
#include <ngx_config.h> | |
#include <ngx_core.h> | |
#include <ngx_http.h> | |
static char *ngx_http_hello_world(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); | |
static ngx_command_t ngx_http_hello_world_commands[] = { | |
{ ngx_string("hello_world"), | |
NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS, |
OlderNewer