Skip to content

Instantly share code, notes, and snippets.

View sairion's full-sized avatar
⚛️

Jaeho Lee (Jay) sairion

⚛️
View GitHub Profile
@sairion
sairion / README.md
Created January 3, 2018 16:25 — forked from ahmadsoe/README.md
VPNGate Python script

#VPNGate for OS X This script is a simple script for using to connect vpn server list provided VPNGate through OpenVPN on OS X environment.

It inspired by VPNGate Python script wrtten by Andrea Lazzarotto.

##Requirements If you use the script, Tunnelblick needs to be installed first.

##Installation Open terminal app and copy & paste the command below.

@sairion
sairion / isdigit_bench.js
Last active May 5, 2017 17:29
isdigit_bench.js
function isDigit_parse(num){ return !Number.isNaN(Number(num.trim())) } // should trim for same functionality
function isDigit_regex(num){ return rgx.test(num) }
var ts = 'a'
var emptyString = ''
var ts2 = 'b'
var rgx = /^[0-9]+$/
console.time('pI')
@sairion
sairion / hacker-news.js
Last active April 15, 2017 13:19
trim and fetch some hn stuff
/*
function setCustomStyle(content) {
let style = q('#custom-style')
if (q('#custom-style') === null) {
style = document.createElement('style')
style.id = 'custom-style'
document.head.appendChild(style)
}
style.textContent = content
}
function range(limit) {
return Array.from(Array(limit)).map((_,i) => i)
}
function piramid(height = 10) {
return range(height).reduce((ret, i) => {
let space = ' '.repeat(height - i)
let slope = '*'.repeat(i)
return ret + `${space}${slope}*${slope}${space}\n`
}, '\n')
@sairion
sairion / bitwise-hacks.js
Created February 28, 2017 07:42 — forked from leodutra/bitwise-hacks.js
Fast Int Math + Bitwise Hacks For JavaScript
// http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html
// http://jsperf.com/bitwise-vs-math-object
// http://united-coders.com/christian-harms/results-for-game-for-forfeits-and-the-winner-is/
// https://mudcu.be/journal/2011/11/bitwise-gems-and-other-optimizations/
// https://dreaminginjavascript.wordpress.com/2009/02/09/bitwise-byte-foolish/
// http://jsperf.com/math-min-max-vs-ternary-vs-if/24
"use strict";
var PI = Math.PI;
  1. You can override constructor output by returning object type.
class A {
  constructor(){
    return new Number(0)
  }
}
console.log(new A == 0) // => true
function benchDedupe(inputSize = 10000000) {
var fixtureNumbers = Array.from({ length: inputSize }).map(() => (Math.random() * 10) | 0)
var fixtureStrings = fixtureNumbers.map(e => String(e))
var fixtureObjects = (function(){
var res = [];
for (var i = 0, rando; i < inputSize; i++) {
rando = (Math.random() * 6) | 0
switch(rando) {
case 0: res[i] = new Object(); break;
case 1: res[i] = res[(Math.random() * res.length) | 0]; break;

대학시절 ux를 공부하던 때, '모든 곳에 ui와 ux가 필요하다' 라는 생각으로 ui 디자인은 매우 중요한 일이 될 거라고 생각했었다. 정말 누구에게도 안 부끄러울 정도로 열심히 공부하기도 했고, 시중에 있는 책도 거의 다 읽어봤고. 그런데 지금 생각해보니 너무 기본적인 것부터 생각을 잘못했다는 걸 느낀다.

모든 곳에 ui와 ux가 필요할지는 모르지만 그것을 디자이너가 손으로 디자인해야 하는 일은 잘 없다. 모든 사람들이 옷을 입는다고 모든곳에 테일러가 필요하지 않은 것처럼. 복잡도가 높은 컨텐츠의 예산은 엄청나게 올라가기 때문에 사람들은 컨텐츠의 복잡도를 줄이는 전략을 택하지, 디자이너를 고용해서까지 컨텐츠 자체를 유지하려고 하지는 않는다. (디자이너들에 대한 비난처럼 될 지도 모르겠지만, 디자이너가 사실 할 수 있는 건 잘 정돈하는 것 정도다. 당연하게도 이것은 도움이 되지 않는다. 최고의 정리는 버리는 것이라고도 하지 않았나.)

결국 몇년이 지나, 수많은 웹사이트들은 인스타그램 계정과 페이스북 페이지가 되어버렸다. 나만해도 그게 더 편하다. 웹사이트들은 어렵게 물어물어 찾아가야 하니까. 웹사이트는 이제 정말 아무 것도 아닌 시대다. 불편하기로 치면 책이나 dvd를 보는 것보다 불편하다. 고밀도의 정보를 포함한 종류의 웹사이트가 아니라, 무언가에 대한 전시나 디스플레이를 위한 데스크탑향의 웹사이트라면 이게 존재해야 할 이유가 없다고 생각한다.

옛날에는 정말 병적일 정도로 열심히 마음에 드는 웹사이트들을 정리하고 북마킹하고 심지어 엑셀로 시트를 만들어서 분류까지 해 놨었다. 손을 떨면서 다 지워버렸는데, 아쉬움이 없다. 사실 그 중 1/4정도의 사이트들은 접속도 안되고, 호스트네임이 남아있으면 다행인 수준이었다. 나는 웹 개발자이고 웹이 가장 편하기에 거의 데스크탑 웹만 이용하는 사람이지만, 하여간 여러가지로 허무함을 느끼게 되는 순간이었다.

{// scoped
class A {
a () { return 1 }
}
// wraps existing function
function baseWrapApplier(theConstructor, appliyingKey, descriptor) {
if (theConstructor.prototype[appliyingKey]) {
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import Composer from 'react-native-message-composer';
import {
AppRegistry,