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
"hello _there_".replace(/_(.*?)_/, function(a, b){ | |
return '<div>' + b + '</div>'; | |
}) | |
"hello _there_".replace(/_(.*?)_/, "<div>$1</div>") |
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 timeToLoadMore( threshold ){ | |
var wScrollTop = $(window).scrollTop(), | |
wHeight = $(window).height(), | |
dHeight = $(document).height(); | |
return dHeight - (wHeight + wScrollTop) < threshold; | |
} |
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
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
var yoonsyFunc = function(date){ | |
s = console.log; | |
E = function(a) { | |
a = "undefined" == typeof a ? 1 : a; | |
var c = "/bt/bt_info.cache?" + date.getTime(), | |
d = { logintimeout: "", key: "" }; | |
return $.ajax({ |
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
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then | |
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share | |
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" | |
fi | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi |