Skip to content

Instantly share code, notes, and snippets.

View inceax's full-sized avatar

Jangho Lee inceax

View GitHub Profile
* {
font-family: "Noto Sans CJK KR DemiLight";
}
@font-face {
font-family: "굴림";
src: local("Noto Sans CJK KR DemiLight");
}
@font-face {
font-family: "돋움";
src: local("Noto Sans CJK KR DemiLight");
}
@inceax
inceax / co-example-a.js
Last active March 9, 2016 14:08
node.js co example
co(function* () {
var a = yield new Promise(function(resolve, reject) {
setTimeout(() => resolve("ok"), 100);
});
console.log("result: " + a);
var b = yield new Promise(function(resolve, reject) {
setTimeout(() => reject("fail"), 100);
});
console.log("result: " + b);
}).catch(function(e) {
// normalized(0-1) 단위
// { average: 0.06, cpus: [ 0.06, 0.05, 0.05, 0.08 ] }
// warning: 부팅 이후의 값이므로, 실시간 측정은 불가능
const cpustat = function () {
const cpus = os.cpus();
const result = {};
result.average = 0;
result.cpus = [];
for (let i = 0; i < cpus.length; i++) {