Skip to content

Instantly share code, notes, and snippets.

View insanehong's full-sized avatar

DeokHong Kim (a.k.a insanehong) insanehong

View GitHub Profile
@insanehong
insanehong / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@insanehong
insanehong / anagram.js
Last active August 29, 2015 14:03
javascript anagram check
function isAnagram(a ,b) {
if(a ===b) return true;
return (resort(a) === resort(b));
function resort(s) {
return s.split("").sort().join("");
}
}
@insanehong
insanehong / FizzBuzz.js
Last active December 30, 2015 03:29
FizzBuzz Test
var i=1,cal;
for (;i<=100;i++) {
cal = (i%15===0) ? 'FizzBuzz' : (i%3===0) ? 'Fizz' : (i%5===0) ? 'Buzz' : i;
console.log(cal);
}
/* http://www.smartstudy.co.kr/data/dev_2012.html */
/* 정의역이 실수인 반올림 함수 */
function MyRound(f) {
return parseInt(f + 0.5, 10);
}
/*
정의역이 정수일때 gamma(n+1) == n! 을 이용한 factorial 함수
gamma 함수는 실수의 factorial 을 계산하기 위한 적분 함수이지만 실수에 대한 처리부분이 빠져있기에