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
@caasi
caasi / main.ls
Last active December 11, 2015 01:18
Is it possible to outsource OCR as a blog widget or a AD inside a game?
requests = {}
require! GitHubApi: \github
github = new GitHubApi version: \3.0.0
github.authenticate require \./config-github
# inspired by g0v/twlyparser/github.ls
class OCRIssues
issues: []
last-update: 0
@caasi
caasi / extend_racing.yml
Created March 6, 2013 18:29
extend_racing
languages:
zh-TW
zh-CN
en-US
root:
index:
news:
default
products
stories
frac = [1 1 2 6 24 120 720]
for a from 1 to 6
for b from 0 to 6
for c from 0 to 6
console.log "#{a}#{b}#{c}" if 100 * a + 10 * b + c is frac[a] + frac[b] + frac[c]
@caasi
caasi / gist:5894089
Created June 30, 2013 06:20
jade error
fs.js:476
var r = binding.read(fd, buffer, offset, length, position);
^
Error: EISDIR, illegal operation on a directory
at Object.fs.readSync (fs.js:476:19)
at Object.fs.readFileSync (fs.js:310:28)
at Object.rethrow (/usr/lib/node_modules/jade/lib/runtime.js:168:27)
at parse (/usr/lib/node_modules/jade/lib/jade.js:109:13)
at Object.exports.compile (/usr/lib/node_modules/jade/lib/jade.js:154:9)
at Socket. (/usr/lib/node_modules/jade/bin/jade:122:19)
@caasi
caasi / ISR_rules.md
Last active December 20, 2015 08:09

THE RULES

Much like Ben Stein, many boring things are important, and ultimately fulfilling on a deep emotional level that you don't yet fully understand. Rules are just one of those tedious things that we've got to wade through before the fun begins. And if you do what we like to call "pulling a EULA" and just scroll down to the bottom without reading the deets, then we can't be held responsible for when your mind-bogglingly astounding piece of awesome-sauce gets disqualified on a technicality.
就像斑史坦(的聲音),很多無聊的事情很重要,最終會滿足你搞不清楚的深層情感。規則只是在樂趣開始前,得搞定的無聊事之一。如果你只是捲到底沒細看,像我們俗稱的「把 EULA 拉到底」,那當你那 mind-bogglingly astounding piece of awesome-sauce 被取消資格時,我們無法負責。

Also see our FAQ Page
也別忘了看我們的 FAQ 頁。

THE BASICS:

@caasi
caasi / reduce.coffee
Last active December 20, 2015 13:09
reduce rocks!
# reduceRight exists, dumb me
do words.reduceRight (next, current) ->
-> current.draw().then next
, null
@caasi
caasi / another_maybe.ls
Last active December 20, 2015 13:29
Another Maybe implementation in LiveScript
# Maybe monad implementation:
check-nothing = (f) ->
(x) ->
| x is Nothing => Nothing
| otherwise => f x
bind = (f) -> (check-nothing f) do this
Nothing = -> Nothing
Nothing.bind = bind
@caasi
caasi / list.ls
Last active December 20, 2015 14:28
powerset not work >_<
# List monad implementation:
check-empty = (f) ->
(x) ->
| x is Empty => Empty
| otherwise => f.apply null, arguments
# hmmm..., not sure
concat = (xs, ys) ->
| xs is Empty => ys
@caasi
caasi / maybe_backcall.ls
Last active December 20, 2015 14:28
use function as object
# Maybe monad implementation:
m = (value) ->
(f) ->
| f => f value # as bind
| otherwise => value # as unwrap
Nothing = -> Nothing
Just = m
@caasi
caasi / pof-viewer
Created August 15, 2013 04:50
irrlicht pof viewer
./bin/pof-viewer ./pof/Capital01.pof
Irrlicht Engine version 1.7.3
Linux 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013 x86_64
Using renderer: OpenGL 2.1
Mesa DRI Intel(R) 965GM : Intel Open Source Technology Center
OpenGL driver version is 1.2 or better.
GLSL version: 1.2
file id: PSPO
file version: 2117
file size: 2708338