Skip to content

Instantly share code, notes, and snippets.

View ladjzero's full-sized avatar

Zhuo Chen ladjzero

View GitHub Profile
#!/usr/bin/env node
// @ts-check
const fs = require('fs');
const path = require('path');
const inputs = [];
const ERR_REG = /(error|warning): .+ \((.+)\) at (.+):(\d+):(\d+):/;
/**
@ladjzero
ladjzero / aria2.yaml
Last active November 28, 2018 15:54
htpc
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: aria2-deployment
labels:
app: aria2
spec:
replicas: 1
selector:
matchLabels:
@ladjzero
ladjzero / future.js
Created November 14, 2017 01:28
A promise implement.
class Future {
constructor(executor) {
this.status = 'pending';
this.value = undefined;
this.reason = undefined;
this.then = (onFulfilled, onRejected) => {
let value, reason;
if (typeof onFulfilled !== 'function') {