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
" ============================================================================== | |
" Author: Alan Dong | |
" Version: 0.3.5 | |
" Last Modified Date: 8/17/2018 | |
" Description: My Vim Configuration file for Server | |
" ============================================================================== | |
" set shell for bash as default | |
set shell=/bin/bash |
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
" ============================================================================== | |
" Author: Alan Dong | |
" Version: 0.3.4 | |
" README: TODO | |
" Last Modified Date: 12/07/2018 | |
" Description: My Vim Configuration file | |
" ============================================================================== | |
" set shell for bash as default | |
set shell=/bin/bash |
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
// What is the result of the following? | |
for (var i=0; i<10; ++i) { | |
setTimeout(function() { | |
console.log(i); | |
}, 1000); | |
} | |
// using IIFE (immediately invoked function) | |
// with delay |
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 memoize(func) { | |
var memo = {}; | |
var slice = Array.prototype.slice; | |
return function() { | |
var args = slice.call(arguments); // what if func(1,2,3) needs to be treated as the same as func(2,3,1) | |
if (args in memo) { |
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() { | |
var u = 'http://example.com/bookmarklet.js'; | |
u = 'https://cdn.jsdelivr.net/npm/[email protected]/build/circular-json.node.min.js'; | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.charset = 'utf-8'; | |
s.src = u; | |
document.body.appendChild(s); | |
})() |
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
# Path to your oh-my-zsh installation. | |
export ZSH=~/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Uncomment the following line to use case-sensitive completion. |
NewerOlder