This file contains 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
function loadScript(url, callback){ | |
var script = document.createElement("script") | |
script.type = "text/javascript"; | |
if (script.readyState){ //IE | |
script.onreadystatechange = function(){ | |
if (script.readyState == "loaded" || | |
script.readyState == "complete"){ | |
script.onreadystatechange = null; |
This file contains 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 _geocode(self, address, *args, **kwargs): | |
url = 'http://maps.googleapis.com/maps/api/geocode/json' | |
payload = { | |
'address': address+' '+self.state, | |
'sensor': 'false', | |
} | |
r = requests.get(url, params=payload) | |
if r.status_code == 200: | |
data = r.json |
This file contains 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
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
" Ctrlp options | |
let g:ctrlp_root_markers = ['.ctrlp'] | |
let g:ctrlp_prompt_mappings = { | |
\ 'AcceptSelection("e")': ['<c-t>'], | |
\ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'], | |
\ } | |
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*.,*/.DS_Store,*/tmp/* |
This file contains 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
Download latest version of mac vim | |
https://github.com/b4winckler/macvim/releases | |
Install pathogen.vim(manages plugins) | |
http://www.vim.org/scripts/script.php?script_id=2332 | |
Install a theme possibly: | |
https://github.com/altercation/vim-colors-solarized | |
Install CtrlP |
This file contains 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
#!/usr/bin/env node | |
var request = require('request'), | |
fs = require('fs'), | |
Promise = require('bluebird'), | |
baseUrl = '', | |
patchName = process.argv[2].toString(), | |
formData = { | |
file0: fs.createReadStream(`/Users/skytap/src/current/ui_nodejs/.hg/patches/${patchName}`), | |
json: '{"parameter":[{"name":"ui_nodejs/.hg/patches/test_patch","file":"file0"}]}' | |
}; |
This file contains 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
save: -> | |
# avoid making a request before one comes back | |
return if @prop('busy') | |
@prop('busy', true) | |
# we want to delete first so that when we call save we get updated response without the deleted models | |
@delete().then => | |
@save() | |
.then (models) => | |
# # add the response of models to the collection | |
@reset(models) if models.length |
This file contains 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
find . -type f -print0 | xargs -0 -n 1 sed -i -e 's/module.exports.*/module.exports = ->/g |
This file contains 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
let b:cucumber_root = '~/src/current/ui/test/features/step_definitions' | |
if !exists("b:cucumber_steps_glob") | |
let b:cucumber_steps_glob = b:cucumber_root.'/**/*' | |
endif | |
function! s:getallsteps() | |
let step_pattern = '\/\^.*$\/' | |
let steps = [] | |
for file in split(glob(b:cucumber_steps_glob),"\n") | |
let lines = readfile(file) |
This file contains 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
# this function will search all passed arguments for optionalFlag's existence | |
function test() { | |
if [[ $* == *--optionalFlagt* ]] | |
then | |
do stuff | |
else | |
do other stuff | |
fi | |
} |