Skip to content

Instantly share code, notes, and snippets.

View JustinChoi21's full-sized avatar
😃
Good!

Heechul Choi JustinChoi21

😃
Good!
View GitHub Profile
@JustinChoi21
JustinChoi21 / gist:f528bebf02b01783d96c
Last active August 29, 2015 14:13
프로젝트 오일러 문제 풀이
// 2. 피보나치 수열에서 4백만 이하이면서 짝수인 항의 합
var first = 1;
var second = 2;
var total = 0;
while (second <= 4000000) {
var third = first + second;
if (second % 2 == 0) {
@JustinChoi21
JustinChoi21 / 2.9_3.js
Last active August 29, 2015 14:13
Data Structures & Algorithms with Javascript 문제 풀이
/*
* p63 연습문제3
* 이차원 배열을 이용해 월간 온도 자료를 저장하도록 weeklyTemps 객체를 고치시오.
* 월간 평균, 지정한 주의 평균, 모든 주의 평균을 출력하는 함수를 만드시오.
*/
var temps = [][]; //이차원 배열 데이터
var Temps = function (temps){
this.temps = temps;
@JustinChoi21
JustinChoi21 / gist:4046462c5e9584202c71
Created January 12, 2015 06:42
Javascript 유용한 코드 모음
/* break 와 return 활용 */
// break는 for문을 종료 시킴 => console.log("end") 가 찍힘
(function forBreakReturnTest() {
console.log("start");
for (var inx = 0; inx < 10; inx ++) {
console.log(" inx : " + inx );
if(inx == 5) {
@JustinChoi21
JustinChoi21 / gist:fe2c8f8e8ad6d6f9a1d9
Last active August 29, 2015 14:14
javascript callback CPS(continuation-passing style)
2. CPS(continuation-passing style) 스타일로의 변경
이 섹션에서는 direct style 에서 CPS로 쉽게 변경하는 몇가지 테크닉을 보여줄 것이다.
2.1 함수 호출 순서
- 매우 자주, 순차적인 함수 또는 메소드 호출을 한다. 이전 예제에서는 보기 흉한 중첩(nesting) 함수들을 봤을 것이다.
그러나, 함수 선언을 사용하여 이러한 상황을 피할 수 있다.
function loadAvatarImage(id, callback) {
@JustinChoi21
JustinChoi21 / 0.basic.html
Last active August 29, 2015 14:16
jQuery Mobile source
<!-- jQuery Mobile 기본구조 -->
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>jQuery Mobile Basic</title>
<!-- 1. viewport 설정 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scaleable=no">
@JustinChoi21
JustinChoi21 / README.md
Last active May 30, 2016 06:26
GMF (GitHub Flavored Markdown 문법 정리)

##줄바꿈 enter

##헤더 #헤더

##리스트

  • 리스트1
  • 리스트2
  • 리스트3
@JustinChoi21
JustinChoi21 / .gitignore
Last active January 23, 2018 07:13
.gitignore Templeate
####################################################################
# How to use #
# *.a : no .a files
# !lib.a : but do track lib.a though you're ignoring .a files above
# /TODO : only ignore the root TODO file, not subdir/TODO
# build/ : ignore all files in the build/ directory
# doc/*.txt : ignore doc/dotes.txt, but not doc/server/arch.txt
####################################################################
# Compiled source #
@JustinChoi21
JustinChoi21 / gist:33654d8a44a0e1070440
Last active May 11, 2018 10:26
각종 알고리즘 소스 모음 (직접 짜본 소스)
// DFS (Depth First Search)
var n = 8; // 정점의 총 개수
var map = [];
var visit = [];
function dfs(v) {
visit[v] = 1;
@JustinChoi21
JustinChoi21 / 0.3_1.js
Last active February 24, 2020 14:52
문제로 풀어보는 알고리즘 문제풀이
/*
* 0.3 생각해보기
* k를 인자로 받아서 k만큼 오른쪽으로 회전시키는 함수를 작성하라. 오른쪽으로 회전하는 것을 k번 반복하면 되지만 이 방법은 느리다. 더 빠른 방법은?
*/
function rotateArray(arr, s, t, k) {
console.log("start");
var temp = [];
for (var inx = 0; inx < k; inx++) {