Skip to content

Instantly share code, notes, and snippets.

Christopher Sexton csexton

Block or report user

Report or block csexton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View think.markdown

Note to Self

Be Confident

Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.

Be Lazy

View gist:69329
["http://internal/", "http://external/"].each do |server|
uri = URI.parse(server)
God.watch do |w|
w.name = "httpmon_#{uri.host}"
w.interval = 10.seconds
w.start = "echo 'start'"
w.stop = "echo 'stop'"
w.lifecycle do |on|
on.condition(:http_response_code) do |c|
View gist:77882
def self.fill_in_the_gaps(date_array,value_array,num_of_values)
#out of 2 arrays, one
date_value_array = []
date_array.length.times do
date_value_array << [[Time.parse(date_array.pop.to_s).strftime("%Y-%m-%d")],[value_array.pop]]
end
# fill in the gaps with zeros
val_index = 0
dates = []
View gist:77890
def fill_in_the_gaps(date_array,value_array,num_of_values)
#out of 2 arrays, one
date_value_array = []
date_array.length.times do
date_value_array << [[Time.parse(date_array.pop.to_s).strftime("%Y-%m-%d")],[value_array.pop]]
end
# fill in the gaps with zeros
val_index = 0
dates = []
View .bash_history
ls
cd jekyll/
ls
cd converters/
ls
ls
cd blogger/
View gist.vim
"
" :Gist -e foo.js
" edit the gist with name 'foo.js'. (shoud be work on gist buffer)
View gist.vim
"=============================================================================
" File: gist.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 13-Mar-2009. Jan 2008
" Version: 2.3
" WebPage: http://github.com/mattn/gist-vim/tree/master
" Usage:
View gist.vim
"=============================================================================
" File: gist.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 13-Mar-2009. Jan 2008
" Version: 2.3
" WebPage: http://github.com/mattn/gist-vim/tree/master
" Usage:
View gist.vim
" post whole text to gist.
"
" :'<,'>Gist
" post selected text to gist.
View gist.vim
" # detect filetype if vim failed auto-detection.
" let g:gist_detect_filetype = 1
You can’t perform that action at this time.