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
# code sample for httperf test | |
# - no cache | |
# get "/archive/?*" do | |
# items = archive_items | |
# haml :archive, :layout => choose_layout, :locals => { :state => :archive } | |
# end | |
httperf --client=0/1 --server=localhost --port=9001 --uri=/archive --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1 | |
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to FD_SETSIZE | |
Maximum connect burst length: 1 |
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 'benchmark' | |
# require libs here | |
iterations = ARGV[0]||100000 # pass in iterations or | |
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
--- a/db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb | |
+++ b/db/migrate/20120209231801_change_pages_allowed_children_cache_to_text.rb | |
@@ -1,9 +1,9 @@ | |
class ChangePagesAllowedChildrenCacheToText < ActiveRecord::Migration | |
def self.up | |
- change_column :pages, :allowed_children_cache, :text | |
+ remove_column :pages, :allowed_children_cache | |
+ add_column :pages, :allowed_children_cache, :text | |
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
:Gist -- posts a gist | |
:Gist -l -- lists my gists |
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
" for use before a colorscheme definition | |
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red | |
" for use when not using a colorscheme | |
" highlight ExtraWhitespace ctermbg=red guibg=red | |
" show unwanted whitespace | |
match ExtraWhitespace /\s\+\%#\@<!$/ | |
" strip unwanted trailing whitespace on save |
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 bash | |
files=( $( ls -a -d1 .* | grep -v .git | xargs echo ) ) | |
for file in "${files[@]}" | |
do | |
test -L ~/$file && rm -v ~/$file | |
test -f ~/$file && mv -v ~/$file ~/$file.bak | |
test -f $file && \ | |
ln -v -s $(pwd)/$file ~/$file | |
done |
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
" :Shell <cmd> | |
" put shell command in new buffer. | |
command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>) | |
function! s:RunShellCommand(cmdline) | |
echo a:cmdline | |
let expanded_cmdline = a:cmdline | |
for part in split(a:cmdline, ' ') | |
if part[0] =~ '\v[%#<]' | |
let expanded_part = fnameescape(expand(part)) | |
let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '') |
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 bash | |
if test "$( zsh --version | awk '{print $2}' | awk -F'.' ' $1 >= 4 && $2 >= 3 && $3 >= 17 ' )" | |
then | |
# do someting that only higher zsh versions support | |
else | |
# do something else for low versions | |
fi |
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 bash | |
################################################################################ | |
# Author: Joshua Mervine <joshua@mervine.net> | |
# Date: 2012-10-19 | |
# | |
################################################################################ | |
# set up optional variables | |
################################################################################ | |
test "$UNICORN_ROOT" || UNICORN_ROOT="$(pwd)" |
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
# Directory pathing context should be that of the thin | |
# init script sourcing this file, not this file itself. | |
# | |
# allow for overides as such | |
# | |
test "$RACK_ENV" || RACK_ENV="production" | |
test "$THIN_PORT" || THIN_PORT="4321" | |
test "$THIN_PID" || THIN_PID="./log/listener.pid" | |
test "$THIN_LOG" || THIN_LOG="./log/listener.log" | |
test "$THIN_ADDY" || THIN_ADDY="0.0.0.0" |