Skip to content

Instantly share code, notes, and snippets.

View yoonsy's full-sized avatar

Sukyoung Yoon yoonsy

  • Seoul, South Korea
View GitHub Profile
@yoonsy
yoonsy / .bash_profile
Last active July 19, 2018 02:36
My bash profile
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
@yoonsy
yoonsy / korail.js
Last active January 16, 2018 00:53
2016 추석 기차 예매했던 스크립트
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({
@yoonsy
yoonsy / uri.js
Last active August 29, 2015 14:13 — forked from jlong/uri.js
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"
@yoonsy
yoonsy / timeToLoadMore.js
Last active August 29, 2015 13:57
determine time to load more. for infinite scroll.
function timeToLoadMore( threshold ){
var wScrollTop = $(window).scrollTop(),
wHeight = $(window).height(),
dHeight = $(document).height();
return dHeight - (wHeight + wScrollTop) < threshold;
}
@yoonsy
yoonsy / regex_matched_group.js
Created April 12, 2013 08:35
JS 특정 패턴과 일치하는 문자열 뽑아내기
"hello _there_".replace(/_(.*?)_/, function(a, b){
return '<div>' + b + '</div>';
})
"hello _there_".replace(/_(.*?)_/, "<div>$1</div>")