Skip to content

Instantly share code, notes, and snippets.

@ronkot
ronkot / rastas-promise.js
Last active July 25, 2023 05:42
Simple Promise implementation
const PENDING = 1;
const RESOLVED = 2;
const REJECTED = 3;
const callLater = (fn) => setTimeout(fn, 0);
class Promise {
constructor(initPromiseFn) {
this._state = PENDING;
this._value = undefined;
@ronkot
ronkot / .babelrc
Last active August 1, 2016 12:36
babel-plugin-rewire problem
{
"presets": ["es2015", "es2015-node4", "async-to-bluebird"],
"env": {
"test": {
"plugins": ["babel-plugin-rewire"]
}
}
}
@ronkot
ronkot / post-commit
Last active August 29, 2015 14:08 — forked from mashihua/post-commit
#!/usr/bin/env node
//please requist your app token from
//https://trello.com/1/connect?key=yourkey&name=git-hook&expiration=never&response_type=token&scope=read,write
var key = "your key";
var token = "your token";
//https://trello.com/board/-/4e9003324a517dad44465056
var board_id = "4e9003324a517dad44465056";
var Trello = require("node-trello");