Skip to content

Instantly share code, notes, and snippets.

View gseok's full-sized avatar
:octocat:
Happy

gyeongseok.seo gseok

:octocat:
Happy
View GitHub Profile
@gseok
gseok / client-logger.ts
Created February 17, 2022 11:48
심플한 js 클라이언트향 커스텀 logger
// formatDate helperz
export const DAY_WEEK = ['일', '월', '화', '수', '목', '금', '토'];
export const WEEK_NUMBER = 7;
export const HOURS = 60 * 60 * 1000;
export const MINUTES = 60 * 1000;
export const twoDigits = (num: number): string => {
return num < 10 ? `0${num}` : `${num}`;
};
/*
@gseok
gseok / Execution-Context.md
Created June 9, 2021 07:43 — forked from snaag/Execution-Context.md
Execution Context

들어가며

지난 JavaScript, Front-End 발표 주제는 this 였지만, 공부하다 보니 실행 컨텍스트에 대한 내용이 선행되야 할 것 같아 실행 컨텍스트에 대하여 발표를 하게 되었다.

여러 자료와 책을 참고하며 공부를 하고 있음에도 내용이 잘 와닿지 않아 참고1참고2, 참고3, 참고4, 책 인사이드 자바스크립트, Poiema Web을 참고하여 번역을 해보고자 한다. 추가적으로 내가 여러 자료를 찾아보면서 알게 된 내용들도 덧붙일 것이다.

실행 컨텍스트, Execution Context(이하 EC) 라는 개념은 나에겐 낯설었기에 나와 같은 사람들이 있을 것 같아 흔히들 아는 콜스택 을 시작으로 글을 써보도록 하겠다.

@gseok
gseok / Instructions.md
Created March 31, 2021 00:27 — forked from pgilad/Instructions.md
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@gseok
gseok / Swipe.ts
Created February 5, 2021 10:58
Simple Swipe control util class with ts
export interface TouchEventExt extends TouchEvent {
center: {
x: number;
y: number;
};
}
class Swipe {
element: HTMLElement;
@gseok
gseok / Count Code lines
Created November 24, 2020 07:55 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
@gseok
gseok / nginx-restart.bat
Created November 23, 2020 11:07
Quick startup for NGINX and PHP on Windows
@ECHO OFF
call nginx-stop.bat
call nginx-start.bat
EXIT /b
@gseok
gseok / run-server-watch-with.js
Created August 14, 2020 05:29
run-server-watch-with
#!/usr/bin/env node
const fs = require('fs');
const yargs = require('yargs');
const inquirer = require('inquirer');
const webpack = require('webpack');
const getConfig = require('./build/webpack.config');
const { spawn } = require('child_process');
let ps = null;
@gseok
gseok / forever.js
Created June 22, 2020 00:25
Simple Node forever code
#!/usr/bin/env node
const spawn = require('child_process').spawn;
const cmd = process.argv.shift(); // node cmd path
const args = ['./bin/www'];
// server starter is exit then exit all
let ps = null;
function killChildProcess() {
if (ps) {
@gseok
gseok / 2019-10-01_Jenkins_Abort.md
Last active October 1, 2019 23:33
Jenkins Cancel(Abort) 처리

Jenkins Abort

소개

약간 시대에 뒤떨어지는 UI/UX & 사용법으로, 사용자들이 많이 이탈하였지만, 아직도 Top20 등으로 CI/CD Tool검색시 항상 포함되는 정통의 강자가 Jenkins 이다. 여기서는, Jenkins의 Abort(Cancel) action에 대한 후처리(post control or after control)를 별도의 plugin설치 없이 simple하게 하는 방법에 대하여 설명한다.

why needed?

  • 현재 프로젝트에서, 서버로 API를 쏘는 CLI을 사용중인데, Jenkins에서 Cancel하여도, 실제 Build or Deploy동작은 Cancel되지 않는 문제가 있음.
  • 해결방법으로, Jenkins에서 Cancel하면, 해당 동작을 감지하여 서버에 Cancel API을 호출하여 실제 Build or Deploy동작을 Cancel처리 하고자 함.

pre required knowledge

@gseok
gseok / ClearLocal.js
Created September 18, 2019 00:01
Git Local Branch Clear When Remote Branch PR Merge and Deleted
#!/usr/bin/env node
const { spawn } = require('child_process')
const REMOTE_START_STR = 'remotes/origin/'
const runCommand = async (command, options) => {
return new Promise((resolve, reject) => {
const prc = spawn(command, [...options], {
cwd: process.cwd(),
})