Skip to content

Instantly share code, notes, and snippets.

View schan90's full-sized avatar

SCHAN90 schan90

View GitHub Profile
@schan90
schan90 / toallemployees.md
Created July 11, 2017 08:23 — forked from marsam/toallemployees.md
TO ALL EMPLOYEES

TO ALL EMPLOYEES

It has been brought to the management’s attention that some individuals have been using foul language in the course of normal conversation between employees. Due to complaints from some of the easily offended workers, this conduct will no longer be tolerated.

The management does, however, realize the importance of each person being able to properly express their feelings when communicating with their fellow employees. Therefore, the management has compiled the following code phrases so that the proper exchange of ideas and information can continue.

OLD PHRASE                                               NEW PHRASE

No fucking way ......................................... I’m not certain that’s feasible.

You’ve got to be shitting me ........................... Really.

@schan90
schan90 / 094607.md
Created July 15, 2017 06:35 — 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이라는 명칭이 사용되고 있습니다.

<html><head></head><body>
<section id="todo"></section>
<script>
const Task = class {
constructor() {
this._list = [];
}
add(task) {
this._list.push(task);
}
@schan90
schan90 / MySQL table into CSV file 1.sql
Created August 9, 2017 05:27 — forked from gaerae/MySQL table into CSV file 1.sql
MySQL Table의 데이터를 CSV 형태로 내보내기 방법에는 여러가지가 있습니다. 어떤 방법으로만 해야된다가 아닌 상황에 맞게 사용하는게 좋을 거 같습니다. 4 가지 예시입니다.
SELECT * FROM my_table
INTO OUTFILE 'my_table.csv'
CHARACTER SET euckr
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
@schan90
schan90 / powerset.js
Created August 10, 2017 01:01 — forked from mLuby/powerset.js
Generate power set from a string
function powerset (input) {
return input
.split(input ? '' : false)
.filter(duplicates({}))
.map(concatEmptyStr)
.reduce(multiplyMatrix)
}
function concatEmptyStr (str) {
return str ? ['', str] : ['']
@schan90
schan90 / powerset.iterative.js
Created August 10, 2017 01:11 — forked from lokothodida/powerset.iterative.js
Javascript implementation(s) of a Power Set function
/* Calculates the power set, P(s) := { s' : s' is a subset of s }
* Assumes an implementation of a Set that has the following methods:
* add, equals, forEach, clone
*/
var powerSet = function(set) {
var prevSet = new Set(); // prevSet := {}
var currSet = new Set().add(new Set()); // currSet := { {} }
// Main loop will continually add elements to currSet until no
// new elements are added
<html><head></head><body>
<section id="todo"></section>
<script>
const TaskState = class {
static addState(key, cls) {
const v = new cls();
if (!(v instanceof TaskState)) throw 'invalid cls';
if ((TaskState._subClasses || (TaskState._subClasses = new Map())).has(key)) throw 'exist key';
TaskState._subClasses.set(key, cls);
}
@schan90
schan90 / mergeSort.js
Created August 24, 2017 01:34 — forked from dsernst/mergeSort.js
Merge Sort in JavaScript
var mergeSort = function(array) {
if (array.length === 1) {
return array
} else {
var split = Math.floor(array.length/2)
var left = array.slice(0, split)
var right = array.slice(split)
left = mergeSort(left)
right = mergeSort(right)
@schan90
schan90 / rbenv-howto.md
Created August 24, 2017 06:27 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@schan90
schan90 / gist.md
Created August 28, 2017 10:03 — forked from benbalter/gist.md
Example of how to embed a Gist on GitHub Pages using Jekyll.

Here's an example of how to embed a Gist on GitHub Pages:

{% gist 5555251 %}

All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.