Skip to content

Instantly share code, notes, and snippets.

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

["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|
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 = []
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 = []
ls
cd jekyll/
ls
cd converters/
ls
ls
cd blogger/
"
" :Gist -e foo.js
" edit the gist with name 'foo.js'. (shoud be work on gist buffer)
"=============================================================================
" 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:
"=============================================================================
" 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:
" post whole text to gist.
"
" :'<,'>Gist
" post selected text to gist.
" # detect filetype if vim failed auto-detection.
" let g:gist_detect_filetype = 1