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
SQL_PARSER_REGEXP = /^(\w+)\s(\w+)\s\W*(\w+)/ | |
ActiveSupport::Notifications.subscribe "sql.active_record" do |name, start, finish, id, payload| | |
if payload[:name] == "SQL" | |
if Thread.current[:stats_context] # where I store the name of the request context | |
payload[:sql] =~ SQL_PARSER_REGEXP # $1 will be the query type, $3 the table | |
Statsd.timing("#{Thread.current[:stats_context]}.sql.#{$3}.#{$1}.query_time", | |
(finish - start) * 1000, 1) | |
end | |
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
# Defaults that we'll need | |
include_recipe "apt" | |
package "vim" | |
package "screen" | |
package "git-core" | |
package "mercurial" | |
package "subversion" | |
package "python" |
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
#Handy Git stuff | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} | |
function git-track { | |
CURRENT_BRANCH=$(parse_git_branch) | |
git-config branch.$CURRENT_BRANCH.remote $1 | |
git-config branch.$CURRENT_BRANCH.merge refs/heads/$CURRENT_BRANCH | |
} |
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
" Vim syntax file | |
" Language: LESS Cascading Style Sheets | |
" Maintainer: Leaf Corcoran <[email protected]> | |
" Modifier: Bryan J Swift <[email protected]> | |
" URL: http://leafo.net/lessphp/vim/less.vim | |
" URL: http://gist.github.com/161047 | |
" Last Change: 2009 August 4 | |
" LESS by Leaf Corcoran | |
" CSS2 by Nikolai Weibull | |
" Full CSS2, HTML4 support by Yeti |
NewerOlder