Skip to content

Instantly share code, notes, and snippets.

View preco21's full-sized avatar
☂️
Recovering

Preco Kim preco21

☂️
Recovering
View GitHub Profile

Atom Personal Settings

@preco21
preco21 / InlineWorker.js
Last active May 25, 2016 01:03
Simple InlineWorker
import Promise from 'bluebird';
import EventEmitter from 'eventemitter3';
class InlineWorker {
constructor(source) {
if (typeof source != 'function') {
throw new TypeError('source must be a function');
}
if (this._worker) {
@preco21
preco21 / concat.array.buffers.js
Last active September 7, 2015 14:30 — forked from 72lions/concat.array.buffers.js
Concatenates two ArrayBuffers
/**
* Creates a new Uint8Array based on two different ArrayBuffers
*
* @private
* @param {ArrayBuffers} buffer1 The first buffer.
* @param {ArrayBuffers} buffer2 The second buffer.
* @return {ArrayBuffers} The new ArrayBuffer created out of the two.
*/
var _appendBuffer = function(buffer1, buffer2) {
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);
@preco21
preco21 / blender-shortcuts.md
Last active November 5, 2020 14:00
Blender 단축키 모음

Blender 3D 단축키

Keys

  • RMB: 마우스 오른쪽 버튼
  • LMB: 마우스 왼쪽 버튼
  • MMB: 마우스 가운데 버튼
  • WHEEL: 마우스 휠

기본 조작

@preco21
preco21 / babel-6.md
Last active March 16, 2023 01:55
Babel 6.x 간단 가이드

Babel 6.x 가이드

Babel은 최신 ES(2015/NEXT) 표준에 맞춰 작성된 코드를 아직 표준 기능을 구현하지 않은 브라우저와 플랫폼에서도 코드가 작동할 수 있도록 만들어주는 코드 transpilerpolyfill 도구의 집합입니다.

Babel 6.x 버전부턴 많은 기능이 추가되었고 운용 방식이 설정(config) 기반 방식으로 바뀌었습니다.

설치와 사용

@preco21
preco21 / readme.md
Last active March 11, 2021 11:29 — forked from coolaj86/how-to-publish-to-npm.md
NPM에 패키지(모듈) 배포하는 법

NPM 시작하기(개발자로써)

만약 이전에 NPM author 정보를 설정해놓지 않았다면, 다음 명령으로 등록하세요:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@preco21
preco21 / encode-non-bmp.js
Last active July 4, 2016 08:08
Encode a non-bmp string into HTML entities with ES2015 powered
// encode
'foo © bar ≠ baz 𝌆 qux'.replace(/[\u{00A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);
@preco21
preco21 / benchmark-copy-array.js
Last active August 5, 2016 03:22
Benchmark various methods to copy array in ES2015
import {Suite} from 'benchmark';
const suite = new Suite();
suite
.add('Array Spread Operator', () => {
const a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
const b = [...a];
})
.add('Array.from()', () => {
@preco21
preco21 / .gitignore
Last active June 8, 2016 02:42
Git dotfile templates for BabelJS environment
.DS_Store
node_modules
npm-debug.log
/bin
@preco21
preco21 / getYearDays.js
Last active August 5, 2016 03:39
Get leap year days
function getYearDays(year) {
const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
return isLeapYear ? 366 : 365;
}
export {
getYearDays as default,
};