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
# Select response time, url id, and timestamp from verbose siege output | |
$ awk -F, '{ print $4","$7","$8 }' my_siege.log > ~/response.csv | |
# Load csv file into an R data.frame | |
> foo <- read.csv("~/response.csv", row.names=NULL, colClasses=c("numeric", "factor", "POSIXct"), col.names=c("response.time", "url.id", "timestamp")) | |
# Plot | |
> qplot(timestamp, response.time, data=foo, geom=c("point", "smooth")) | |
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
set nocompatible " We are using Vim | |
syntax on | |
set colorcolumn=80 | |
set ruler | |
hi StatusLine ctermfg=0 ctermbg=3 cterm=bold " Window highlighting | |
hi StatusLineNC ctermfg=0 ctermbg=238 cterm=none | |
hi Folded ctermfg=244 ctermbg=0 cterm=none " Code folding highlight |
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 an R dataframe that has a column of email | |
# addresses, e.g. [email protected], return just | |
# the domain name | |
sapply(strsplit(my.df$email, "@"), "[", 2) |
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
CONTENT_TYPES = {:html => 'text/html', :css => 'text/css', :js => 'application/javascript'} | |
before do | |
request_uri = case request.env['REQUEST_URI'] | |
when /\.css$/ : :css | |
when /\.js$/ : :js | |
else :html | |
end | |
content_type CONTENT_TYPES[request_uri], :charset => 'utf-8' | |
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
Regexp.new(%w[ www www3 ].collect { |p| Regexp.escape(p) }.join('|')) |
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
library(ggplot2) | |
sparkLinePlot <- function(df, plot.file) { | |
highest <- subset(df, outcomes == max(outcomes)) | |
lowest <- subset(df, outcomes == min(outcomes)) | |
p <- ggplot(df, aes(x=date, y=outcomes)) + | |
geom_line() + | |
opts(panel.border = theme_rect(linetype = 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
git log --oneline -1 | newrelic deployments -c |
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
rvm get latest | |
rvm package install readline | |
rvm install 1.9.2 --with-readline-dir=$rvm_path/usr | |
rvm 1.9.2 --default | |
gem install rails | |
bundle install |
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
require 'rubygems' | |
require 'typhoeus' | |
require 'ap' | |
begin | |
request = Typhoeus::Easy.new | |
request.url = "http://www.google.com" | |
request.max_redirects = 2 | |
request.verbose = 1 | |
request.method = :get |
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
sudo ngrep -d en1 -W byline port 80 and host heroku.com |
OlderNewer