Skip to content

Instantly share code, notes, and snippets.

View laziel's full-sized avatar
๐Ÿณ

Jihan Kim laziel

๐Ÿณ
  • NAVER Corp.
  • Seoul, South Korea
View GitHub Profile
@laziel
laziel / gen.sh
Created July 19, 2021 16:27 — forked from flotwig/gen.sh
Generate a Chrome extension ID with a desired prefix
#!/bin/bash
# https://stackoverflow.com/a/23877974/3474615
while [[ $EXT_PREFIX != "ioio" ]] # change 'ioio' to your desired prefix (can only use lowercase a-p)
do
rm key.pem manifest_key.txt extension_id.txt
2>/dev/null openssl genrsa 2048 | openssl pkcs8 -topk8 -nocrypt -out key.pem
2>/dev/null openssl rsa -in key.pem -pubout -outform DER | openssl base64 -A > manifest_key.txt
@laziel
laziel / interceptors.js
Created September 29, 2020 03:45 — forked from javisperez/interceptors.js
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {
@laziel
laziel / youtube.js
Created November 17, 2018 10:52 — forked from max-te/youtube.js
Download Youtube-Video in node.js
var http = require('http')
var fs = require('fs')
var argv = require('optimist').argv
var rxVideoID = /v=([\]\[!"#$%'()*+,.\/:;<=>?@\^_`{|}~-\w]*)/
var link = argv._.toString()
var videoID = link.match(rxVideoID)[1]
http.get("http://www.youtube.com/get_video_info?video_id="+videoID, function(res) {
var chunks = []
@laziel
laziel / water_ripple_canvas.js
Created May 3, 2017 13:45 — forked from StuPig/water_ripple_canvas.js
Use JavaScript and canvas to create water ripple effect
/*
* Water Canvas by Almer Thie (http://code.almeros.com).
* Description: A realtime water ripple effect on an HTML5 canvas.
* Copyright 2010 Almer Thie. All rights reserved.
*
* Example: http://code.almeros.com/code-examples/water-effect-canvas/
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript
*/
@laziel
laziel / 094607.md
Created April 6, 2016 07:13 — forked from marocchino/094607.md
ES6์‹œ๋Œ€์˜ JavaScript

ES6์‹œ๋Œ€์˜ JavaScript

์•ˆ๋…•ํ•˜์„ธ์š”. ์‚ฌ์›์‚ฌ์—…๋ถ€์˜ ๋งˆ๋ฃจ์•ผ๋งˆ@h13i32maru์ž…๋‹ˆ๋‹ค. ์ตœ๊ทผ์˜ Web ํ”„๋ก ํŠธ์—”๋“œ์˜ ๋ณ€ํ™”๋Š” ๋งค์šฐ ๊ฒฉ๋ ฌํ•ด์„œ, ์กฐ๊ธˆ ๋ˆˆ์„ ๋• ์‚ฌ์ด์— ์ ์  ์ƒˆ๋กœ์šด ๊ฒƒ์ด ๋‚˜์˜ค๊ณ  ์žˆ๋”๋ผ๊ตฌ์š”. ๊ทธ๋Ÿฐ ๊ฒฉ๋ ฌํ•œ ๋ณ€ํ™”์ค‘ ํ•˜๋‚˜๊ฐ€ ES6์ด๋ผ๋Š” ์ฐจ์„ธ๋Œ€ JavaScript์˜ ์‚ฌ์–‘์ž…๋‹ˆ๋‹ค. ์ด ES6๋Š” ํ˜„์žฌ ์žฌ์ •์ค‘์œผ๋กœ ์ง‘ํ•„์‹œ์ ์—์„œ๋Š” Draft Rev31์ด ๊ณต๊ฐœ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค.

JavaScript๋Š” ECMAScript(ECMA262)๋ผ๋Š” ์‚ฌ์–‘์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ตฌํ˜„๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ ๋ชจ๋˜ํ•œ Web ๋ธŒ๋ผ์šฐ์ €๋Š” ECMAScript 5.1th Edition์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ JavaScript์‹คํ–‰ ์—”์ง„์„ ํƒ‘์žฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋‹ค์Œ ๋ฒ„์ „์ธ ECMAScript 6th Edition์ด ํ˜„์žฌ ์žฌ์ •์ค‘์œผ๋กœ, ์•ฝ์นญ์œผ๋กœ ES6์ด๋ผ๋Š” ๋ช…์นญ์ด ์‚ฌ์šฉ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.