Skip to content

Instantly share code, notes, and snippets.

View mooyoul's full-sized avatar
👨‍💻
working from somewhere

MooYeol Prescott Lee mooyoul

👨‍💻
working from somewhere
View GitHub Profile
@mooyoul
mooyoul / font-doduk.sh
Created August 10, 2015 06:09
Download all fonts described by @font-face directive in CSS stylesheet
#!/bin/bash
COLOR_RESET="\033[30m"
COLOR_GREEN="\033[32m"
COLOR_RED="\033[31m"
COLOR_CYAN="\033[36m"
COLOR_WHITE="\033[37m"
sniffTarget=$1
referer="--referer $2"
data=""
/**
* Module dependencies.
*/
const
{ expect } = require('chai'),
Provider = require('../../src/lib/provider');
describe('Provider module', () => {
@mooyoul
mooyoul / kue-create.js
Created May 31, 2016 07:18
kue-create.js
'use strict';
const
kue = require('kue'),
moment = require('moment'),
queue = kue.createQueue();
/*
var job = queue.create('sitemap', {
title: `Sitemap build #${moment(new Date()).format('YYYYMMDDHHmmss')}`
@mooyoul
mooyoul / hackyhackyhacky.js
Created June 16, 2016 18:39
kakaotalk-ios-webview-hack
// This is a workaround for XHR deny issue with KakaoTalk Webview.
// It is really hacky way. Not recommended.
if (location.protocol !== 'https:') {
location.href = 'https://your.website.com'; // Specify https scheme!
}
@mooyoul
mooyoul / stack-test.js
Created December 12, 2016 05:58
Getting line number on Runtime in Node.js (or other V8 related projects)
/**
* Bla bla bla...
* some comments..
*/
require('./stack');
console.log('now: ', __lineno);
console.log('now: ', __lineno);
@mooyoul
mooyoul / example.tf
Last active December 18, 2016 19:21
Terraform 101
resource "digitalocean_droplet" "web" {
name = "tf-web"
size = "512mb"
image = "centos-5-8-x32"
region = "sfo1"
}
resource "dnsimple_record" "hello" {
domain = "example.com"
name = "test"
@mooyoul
mooyoul / example.tf
Last active December 18, 2016 20:56
Terraform 101 - Build Infrastructure
provider "aws" {
access_key = "ACCESS_KEY_HERE"
secret_key = "SECRET_KEY_HERE"
region = "ap-northeast-2"
}
resource "aws_instance" "example" {
ami = "ami-f293459c"
instance_type = "t2.micro"
}
// below line equal as
// const Promise = require('bluebird');
// const getConnection = Promise.promisify(pool.getConnection.bind(pool));
const getConnection = () => {
return new Promise((resolve, reject) => {
pool.getConnection((e, connection) => {
if (e) { return reject(e); }
resolve(connection);
});
@mooyoul
mooyoul / example.tf
Created December 19, 2016 16:40
Terraform 101 - Change configuration
resource "aws_instance" "example" {
ami = "ami-983ce8f6"
instance_type = "t2.micro"
}
@mooyoul
mooyoul / vm-normal.js
Created December 25, 2016 19:27
VM `timeout` issue example
'use strict';
const
vm = require('vm'),
sandbox = {
current: -1
};
console.time('vm-normal');