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
var countries = { | |
ae: 'United Arab Emirates', | |
ag: 'Antigua and Barbuda', | |
ai: 'Anguilla', | |
al: 'Albania', | |
am: 'Armenia', | |
ao: 'Angola', | |
ar: 'Argentina', | |
at: 'Austria', | |
au: 'Australia', |
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
" JSDoc形式のコメントを追加(functionの行で実行する) | |
" hogeFunc: function() の形式と function hogeFunc() に対応 | |
" 関数定義でない場合は、コメントだけ出力する | |
function! AddJSDoc() | |
let l:jsDocregex = '\s*\([a-zA-Z]*\)\s*[:=]\s*function\s*(\s*\(.*\)\s*).*' | |
let l:jsDocregex2 = '\s*function \([a-zA-Z]*\)\s*(\s*\(.*\)\s*).*' | |
let l:line = getline('.') | |
let l:indent = indent('.') | |
let l:space = repeat(" ", l:indent) |
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
function keepTrying(otherArgs, promise) { | |
promise = promise||new Promise(); | |
// try doing the important thing | |
if(success) { | |
promise.resolve(result); | |
} else { | |
setTimeout(function() { | |
keepTrying(otherArgs, promise); |
NewerOlder