Skip to content

Instantly share code, notes, and snippets.

View Joontae-Kim's full-sized avatar
🎯
Focusing

Joontae Kim Joontae-Kim

🎯
Focusing
View GitHub Profile
@RyanJeong
RyanJeong / GITHUB.md
Last active July 4, 2025 13:44
Github 사용법

Github 기본 개념

세 가지 상태

Git은 파일을 Committed, Modified, Staged 이렇게 세 가지 상태로 관리

  • Committed: 데이터가 로컬 데이터베이스에 안전하게 저장됐다는 것을 의미
  • Modified: 수정한 파일을 아직 로컬 데이터베이스에 커밋하지 않은 것을 의미
  • Staged: 현재 수정한 파일을 곧 커밋할 것이라고 표시한 상태를 의미
    워킹 트리, Staging Area, Git 디렉토리

Git의 세 가지 상태는 Git 프로젝트의 세 가지 단계와 연결됨

  • Git directory: git이 프로젝트의 메타데이터와 객체 데이터베이스를 저장하는 곳으로, 다른 컴퓨터에 있는 저장소를 clone할 때 git directory가 생성됨
  • Working tree: 프로젝트의 특정 버전을 checkout 한 것으로, git directory 안에 압축된 데이터베이스에서 파일을 가져와서 working tree 생성
@zcaceres
zcaceres / basic-js-greatest-hits.md
Last active March 23, 2024 22:44
Articles Written to Help New JS Devs
@Joontae-Kim
Joontae-Kim / meta-tags.md
Last active September 19, 2018 02:39 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@tokland
tokland / promise_map.js
Last active September 8, 2024 15:10 — forked from anvk/promises_reduce.js
Execute promises sequentially (one at at a time) and return array with the results
function promiseMap(inputValues, mapper) {
const reducer = (acc$, inputValue) =>
acc$.then(acc => mapper(inputValue).then(result => acc.push(result) && acc));
return inputValues.reduce(reducer, Promise.resolve([]));
}
/* Example */
const axios = require('axios');
@sylvaindethier
sylvaindethier / server.js
Created June 26, 2017 09:36
NodeJS Express server for SPA
// Express
const express = require('express');
const bodyParser = require('body-parser');
const path = require('path');
const PORT = 9000;
const STATIC = path.resolve(__dirname, 'dist');
const INDEX = path.resolve(STATIC, 'index.html');
@zcaceres
zcaceres / Nested-Routers-Express.md
Last active June 9, 2025 06:01
Child Routers in Express

Nested Routers in Express.js

Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params when you had a long URI with multiple parameters and nested routes.

Let's say you're building routes for a website www.music.com. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.

At our application level, we could first have a Router to handle any requests to our albums.

const express = require('express');
@zcaceres
zcaceres / Revealing-Module-Pattern.md
Last active April 2, 2025 11:56
Using the Revealing Module Pattern in Javascript

The Revealing Module Pattern in Javascript

Zach Caceres

Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.

The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.

Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.

Using Function Scope to Create Public and Private Methods

@anvk
anvk / promises_reduce.js
Last active September 8, 2024 15:10
Sequential execution of Promises using reduce()
function asyncFunc(e) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(e), e * 1000);
});
}
const arr = [1, 2, 3];
let final = [];
function workMyCollection(arr) {
@jkubacki
jkubacki / gist:bdf4f3fcc62699fa9707
Created January 21, 2015 18:44
Mac uninstall mongodb
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep mongo
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl remove homebrew.mxcl.mongodb
pkill -f mongod
@jpillora
jpillora / combinations.js
Last active September 7, 2020 15:52
Array/String combinations in JavaScript
//Explaination:
// start with the empty set
// extract the head element
// copy each element in the set with the current head element appended
// recurse
var combinations = function(set) {
return (function acc(xs, set) {
var x = xs[0];
if(typeof x === "undefined")