Skip to content

Instantly share code, notes, and snippets.

View caasi's full-sized avatar
🏝️
Spiritual Homeland

Isaac Huang caasi

🏝️
Spiritual Homeland
View GitHub Profile
;; wast2wasm --spec ./rgb2hsv.wast -o ./rgb2hsv.json
;; wasm-interp --spec ./rgb2hsv.json
(module
(memory 1)
(func $rgb2hsv
(param $r f32)
(param $g f32)
(param $b f32)
(local $M f32)
(local $m f32)
const delay = (ts) => (value) => /* try to define it by youself */
const show = (value) => {
console.log(value)
return value
}
const callAPI = (api, arg) =>
Promise.resolve(`API "${api}" called successfully! ==> ${JSON.stringify(arg)}`)
.then(show)
@caasi
caasi / mathjax-render.js
Created July 18, 2017 17:28
cat ./input.html | node ./mathjax-render.js --config "{TeX: {MAXBUFFER: 30*1024}}"
var deepExtend = require("deep-extend");
var argv = require("yargs").argv;
var getStdin = require("get-stdin");
var cheerio = require("cheerio");
var mjAPI = require("mathjax-node");
function getObject(str) {
var result;
eval("result = " + str);
return result;
# v1.5.0
StringMonoid =
concat: (a, b) -> "#a#b"
str = let @ = StringMonoid
\foo `@concat` \bar `@concat` \baz
console.log str
use strict;
use warnings;
our $VERSION = '0.1';
our %IRSSI = (
authors => 'caasi Huang',
contact => 'caasi.igd at gmail.com',
name => 'bridged_rename',
description => 'rewrite bridged messages',
license => 'MIT',
const actions = [
() => Promise.resolve(0),
() => Promise.resolve(1),
() => Promise.resolve(2),
() => Promise.resolve(3),
() => Promise.reject(new Error('4')),
() => Promise.resolve(5),
() => Promise.reject(new Error('6')),
() => Promise.reject(new Error('7'))
]
const actions = [
() => Promise.resolve(0),
() => Promise.resolve(1),
() => Promise.reject(new Error('森7')),
() => Promise.resolve(3),
() => Promise.resolve(new Error('森77')),
]
const process = () => new Promise((resolve, reject) => {
if (actions.length === 0) resolve(true)
@caasi
caasi / fact.js
Created January 5, 2017 07:28 — forked from lancetw/fact.js
var fact = (function (fact) {
return (function (f) {
return f(function (f) {
return fact(function (n) {
return f(f)(n)
})
})
})(function (f) {
return f(f)
})
@caasi
caasi / 0.in
Last active December 21, 2016 18:17
in
1
199
93 0 1004
193 93 402
56 193 146
20 56 227
127 20 286
34 127 574
27 34 615
1 27 562
@caasi
caasi / g0v-rainbow.svg
Last active November 27, 2016 17:43 — forked from clkao/g0v-rainbow.svg
g0v-rainbow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.