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.
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
["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| |
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
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 = [] |
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
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 = [] |
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
ls | |
cd jekyll/ | |
ls | |
cd converters/ | |
ls | |
ls | |
cd blogger/ |
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
" | |
" :Gist -e foo.js | |
" edit the gist with name 'foo.js'. (shoud be work on gist buffer) |
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
"============================================================================= | |
" File: gist.vim | |
" Author: Yasuhiro Matsumoto <[email protected]> | |
" Last Change: 13-Mar-2009. Jan 2008 | |
" Version: 2.3 | |
" WebPage: http://github.com/mattn/gist-vim/tree/master | |
" Usage: |
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
"============================================================================= | |
" File: gist.vim | |
" Author: Yasuhiro Matsumoto <[email protected]> | |
" Last Change: 13-Mar-2009. Jan 2008 | |
" Version: 2.3 | |
" WebPage: http://github.com/mattn/gist-vim/tree/master | |
" Usage: |
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
" post whole text to gist. | |
" | |
" :'<,'>Gist | |
" post selected text to gist. |
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
" # detect filetype if vim failed auto-detection. | |
" let g:gist_detect_filetype = 1 |
OlderNewer