Skip to content

Instantly share code, notes, and snippets.

View y0c's full-sized avatar
🏠
Working from home

hosung y0c

🏠
Working from home
View GitHub Profile
@y0c
y0c / cloudSettings
Last active October 21, 2021 08:30
Extensions
{"lastUpload":"2021-10-21T08:30:25.640Z","extensionVersion":"v3.4.3"}
@y0c
y0c / init.vim
Last active July 21, 2019 15:18
vim configuration
"Plug list
call plug#begin()
" fzf
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" airline
Plug 'vim-airline/vim-airline' " vim status bar
" git
Plug 'airblade/vim-gitgutter' " git change status
Plug 'tpope/vim-fugitive' " vim git wrapper
" tree
@y0c
y0c / visitor.js
Created December 5, 2018 08:33
코드스피츠 4강 과제
// Refactoring 역활 병합
const Task = class{
constructor(title, date = null) {
if(!title) throw 'invalid title';
this._title = title; this._date = date; this._isComplete = false;
this._list = [];
}
// get title(){return this._title;}
@y0c
y0c / practice.js
Created November 26, 2018 00:34
CodeSptiz 디자인패턴 3강 과제
// Refactoring 역활 병합
const Task = class{
constructor(title, date = null) {
if(!title) throw 'invalid title';
this._title = title; this._date = date; this._isComplete = false;
this._list = [];
}
@y0c
y0c / practice1.js
Created November 19, 2018 14:59
CodeSpitz 디자인패턴 2강과제
const Github = class {
constructor(id, repo) {
this._base = `https://api.github.com/repos/${id}/${repo}/contents/`;
}
load(path){
if(!this._parser) return;
const id = 'callback' + Github.id++;
const f = Github[id] = ({data:{content}}) => {
delete Github[id];
@y0c
y0c / table.js
Created November 13, 2018 17:20
Code Spitz 디자인 패턴 1강 과제
const Info = class {
constructor(json){
const {title, header, items} = json;
if(typeof title != 'string' || !title) throw 'invalid title';
if(!Array.isArray(header) || !header.length) throw 'invalid header';
if(!Array.isArray(items) || !items.length) throw 'invalid items';
this._private = {title, header, items};
}
@y0c
y0c / tmux.config
Created October 8, 2018 04:59
Custom Tmux Configuration
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# for vim
set -g @resurrect-strategy-vim 'Session'
set -g @continuum-restore 'on'
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
@y0c
y0c / htmlParser.js
Last active September 20, 2018 05:15
Code Spitz 3강 과제(json parser미포함)
const START_TAG = '<';
const END_TAG = '>';
const CLOSE_TOKEN = '/';
const textNode = (input, cursor, curr) => {
const idx = input.indexOf(START_TAG, cursor);
curr.tag.children.push({
type: 'text', text: input.substring(cursor, idx)
});
@y0c
y0c / generator99.js
Last active September 7, 2018 12:47
Code Spitz2강 과제
const generator = function*(i, j){
for( let x = 1 ; x <= i ; x ++ )
for( let y = 1 ; y <= j ; y ++ )
yield [x, y, x*y];
};
for(const [i, j, k] of generator(9,9)){
console.log(`${i} x ${j} = ${k}`);
}
@y0c
y0c / iptable-disable.sh
Created July 28, 2018 07:47
linux iptable disable script(run sudo)
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F