Skip to content

Instantly share code, notes, and snippets.

View kyungw00k's full-sized avatar
🎯

Kyungwook, Park kyungw00k

🎯
View GitHub Profile
@kyungw00k
kyungw00k / assertions-compareScreenshot.js
Created November 7, 2016 01:58 — forked from richard-flosi/assertions-compareScreenshot.js
Nightwatch with Visual Regression testing
// assertions/compareScreenshot.js
var resemble = require('resemble'),
fs = require('fs');
exports.assertion = function(filename, expected) {
var screenshotPath = 'test/screenshots/',
baselinePath = screenshotPath + 'baseline/' + filename,
resultPath = screenshotPath + 'results/' + filename,
diffPath = screenshotPath + 'diffs/' + filename;
@kyungw00k
kyungw00k / jquery.postmessage.js
Created October 31, 2016 16:03 — forked from zachleat/jquery.postmessage.js
postMessage polyfill for IE < 8 that uses window.name and queues messages so they aren't lost while polling. Requires a JSON.parse polyfill (like JSON.js).
/*!
* jQuery postMessage - v1.0 - 8/26/2011
*
* Copyright (c) 2011 "zachleat" Zach Leatherman
* Copyright (c) 2009 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://jquery.org/license
*/
/* Forked from http://benalman.com/projects/jquery-postmessage-plugin/
@kyungw00k
kyungw00k / querySelector.polyfill.js
Created October 10, 2016 04:06 — forked from chrisjlee/querySelector.polyfill.js
IE document.querySelector() polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function (selectors) {
var style = document.createElement('style'), elements = [], element;
document.documentElement.firstChild.appendChild(style);
document._qsa = [];
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
window.scrollBy(0, 0);
style.parentNode.removeChild(style);
@kyungw00k
kyungw00k / keybase.md
Created June 17, 2016 05:28
Keybase proof

Keybase proof

I hereby claim:

  • I am kyungw00k on github.
  • I am kyungw00k (https://keybase.io/kyungw00k) on keybase.
  • I have a public key whose fingerprint is 321D 20A2 E832 8F37 CF07 2018 199E 8C68 1ACC 7483

To claim this, I am signing this object:

# Rotate SSH Keys between two host groups
#
# Inspired by http://vicendominguez.blogspot.kr/2014/05/ansible-generating-pub-key-file-and.html
#
- name: Remove current .ssh/
hosts: host_group1, host_group2
remote_user : "{{ user }}"
tasks:
- file: path={{item}} state=absent
@kyungw00k
kyungw00k / highchart.directive.js
Last active September 14, 2015 09:19
AngularJS directive for Highcharts
(function () {
'use strict';
angular.module('ngHighchart')
.directive('chart', function () {
Highcharts.setOptions({
lang: {
loading: '로딩중...',
months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
shortMonths: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
@kyungw00k
kyungw00k / readLineByLine.js
Created August 31, 2015 04:53
Read line by line in NodeJS
require('fs')
.readFileSync(process.argv[2])
.toString()
.split(/\r?\n/)
.forEach(function (line) {
/* do somthing */
})
@kyungw00k
kyungw00k / package.json
Last active September 19, 2016 21:40
Firebase Queue Example
{
"name": "my-queue",
"version": "1.0.0",
"description": "My Queue",
"main": "queue_worker.js",
"dependencies": {
"firebase": "2.x",
"firebase-queue": "^1.0.0"
}
}
@kyungw00k
kyungw00k / introrx.md
Last active August 29, 2015 14:23 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@kyungw00k
kyungw00k / gist:7c92b76d71db460f2b7b
Created May 27, 2015 08:46
bootstrap hack: fix content width inside hidden tabs
/* bootstrap hack: fix content width inside hidden tabs */
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: block; /* undo display:none */
height: 0; /* height:0 is also invisible */
overflow-y: hidden; /* no-overflow */
}
.tab-content > .active,
.pill-content > .active {
height: auto; /* let the content decide it */