Skip to content

Instantly share code, notes, and snippets.

View vincentdchan's full-sized avatar

Vincent Chan vincentdchan

View GitHub Profile
import { isNumber, isNull } from 'lodash-es';
export fun1() {
// do nothing
}
export isNull(...args) {
return isNull(...args);
}
@vincentdchan
vincentdchan / export.js
Last active August 20, 2018 11:42
re-export from another module
// common.js
export * from './some' // export some
export function thing() {}
// index.js
import { some, thing } from './common.js'
// copy from rambda/es/allPass.js
import _curry1 from './internal/_curry1';
import curryN from './curryN';
import max from './max';
import pluck from './pluck';
var allPass = /*#__PURE__*/_curry1(function allPass(preds) {
return curryN(reduce(max, 0, pluck('length', preds)), function () {
var idx = 0;
var len = preds.length;
import { isNull } from 'lodash-es';
var fun = 1;
fun = function scope(...args) {
return isNull(...args);
}
export { fun }
@vincentdchan
vincentdchan / local-ref-by-module.js
Last active August 13, 2018 08:19
Local references by module scope
import { isNull } from 'lodash-es';
export function scope(...args) {
return isNull(...args);
}
console.log(scope(null));
@vincentdchan
vincentdchan / scope.js
Last active May 8, 2020 12:41
Scope Analysis
// module scope start
// Block
{ // <- scope start
} // <- scope end
// Class
class Foo { // <- scope start
@vincentdchan
vincentdchan / simulator.js
Last active February 1, 2018 13:14
LittleReduxSimulator
class LittleReduxSimulator extends Component {
constructor(props) {
super(props);
this.state = this.props.init();
}
dispatch = value => {
this.setState(this.props.update(value));
}
@vincentdchan
vincentdchan / stack.ml
Last active December 10, 2017 14:43
给大佬感受一下OCaml
(* module stack *)
(* 用OCaml的module system 写一个类似C的Stack *)
module type Element = sig
type t
end
module Stack (Ele : Element)
= struct
type elementType = Ele.t
@vincentdchan
vincentdchan / ExpressionParser.cs
Last active August 21, 2018 23:53
parsing math expression
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CalHomework
{
/// <summary>
@vincentdchan
vincentdchan / main.py
Created September 26, 2017 04:58
SpinAnimation
"""
Author: DZ Chan
Date: 2017-09-24
Description: This is a animation generator
"""
from PIL import Image, ImageDraw
import sys, math
'''