Skip to content

Instantly share code, notes, and snippets.

View Gerhut's full-sized avatar
🫥
Can't see me can't see me

George Cheng Gerhut

🫥
Can't see me can't see me
View GitHub Profile
@Gerhut
Gerhut / ranking.png
Last active February 24, 2020 11:38
PGL Ranking @ Mon Feb 24 11:37:46 2020
ranking.png
export interface IThennable<Value, Reason> {
then<
FulfilledValue = never, FulfilledReason = never,
RejectedValue = never, RejectedReason = never,
>(
onFulfilled?: (value: Value) => FulfilledValue | IThennable<FulfilledValue, FulfilledReason>,
onRejected?: (reason: Reason) => RejectedValue | IThennable<RejectedValue, RejectedReason>,
): IThennable<FulfilledValue | RejectedValue, FulfilledReason | RejectedReason>;
}
Rowlet ['Grass', 'Flying']
Normal 847.735
Fire -175.703
Water 1958.29
Electric -468.029
-> Grass 636.905
Ice -663.467
Fighting -447.766
Poison -316.875
Ground -48.6793
No match for "croconaw.com".
No match for "togetic.com".
No match for "flaaffy.com".
No match for "skiploom.com".
No match for "sunkern.com".
No match for "misdreavus.com".
No match for "dunsparce.com".
No match for "teddiursa.com".
No match for "ursaring.com".
No match for "porygon2.com".
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@Gerhut
Gerhut / delay.js
Created April 1, 2016 10:48
Delay
function delay(duration) {
return function (value) {
return new Promise(function (resolve) {
setTimeout(resolve, duration, value)
})
}
}
delay(100)('yanhaijing.com')
.then(delay(200))
@Gerhut
Gerhut / details.md
Created October 26, 2015 05:09
requireMatchingFunctionName add allExcept: ['moduleExports'] option

When allExcept: ['moduleExports'] set, ignore no matching names of function declearation assignment to module.exports.

Valid:

module.exports = function foo() {}

module['exports'] = function bar() {}

k.module.exports = function exports() {}
@Gerhut
Gerhut / define.js
Created October 12, 2015 06:57
AMD to CommonJS Module
var define = function (global) {
function define(id, dependencies, factory) {
if (typeof id == 'function') { // define(factory)
factory = id
dependencies = []
} else if (typeof dependencies == 'function') { // define(?, factory)
factory = dependencies
dependencies = (typeof id == 'string') ? [] : id
}
@Gerhut
Gerhut / metasks.js
Created September 9, 2015 08:20
理想中的 metask 构建方式
var metask = require('metask')
var stylus = metask('stylus')
var autoprefixer = metask('autoprefixer')
var cleancss = metask('cleancss')
var coffee = metask('coffee')
var uglifyjs = metask('uglifyjs')
var jade = metask('jade')
@Gerhut
Gerhut / input.jsx
Created July 9, 2015 11:57
Babel compiler bug with for..of & System.js module
function* a() {
yield 1
yield 2
yield 3
}
for (let b of a()) {
console.log(b)
}