This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
/* * { | |
transition: all .5s; | |
} */ | |
body { margin: 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<style media="screen"> | |
#container { | |
display: flex; | |
flex-direction: row; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local promise = require("promise") | |
local create, resume, status, await = | |
coroutine.create, coroutine.resume, | |
coroutine.status, coroutine.yield | |
local function async(fn) | |
return function(...) | |
local args = {..., n = select("#", ...)} | |
local co = create(fn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// bind :: Monad m => m a -> (a -> m b) -> m b | |
let bind = a => f => a.bind(a)(f); | |
/// cont :: Monad m => m a -> m b -> m b | |
let cont = a => f => a.cont(a)(f); | |
/// id :: a -> a | |
let id = x => x; | |
/// compose :: (b -> c) -> (a -> b) -> a -> c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ($bytes_nextid $= "") | |
$bytes_nextid = 0; | |
if ($bytes_holes $= "") | |
$bytes_holes = 0; | |
function build_byte_table() { | |
$byte_chr_lookup = ""; | |
for (%dec = 0; %dec < 256; %dec++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function callsoon(func) | |
func() | |
end | |
local promise_mt = {} | |
local promise = {} | |
setmetatable(promise, promise_mt) | |
function promise_mt.__call(_, resolver) | |
local status, value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local footstep = sfx { | |
dynamic = { | |
files = {"step1s.wav", "step2s.wav"}, | |
filter = su.distmax(32), | |
is3d = false, | |
isdynamic = true, | |
pitch = su.random(0.9, 1.1), | |
volume = su.lerp(su.unlerp(su.dist, 0, 32), 0, 1) | |
}, | |
simple = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- usage: | |
-- timer(1000, function() print("hey") end) | |
if timerCount == nil then timerCount = 0 end | |
if timerTable == nil then timerTable = {} end | |
function finishTimer(i) | |
i = tonumber(i) | |
timerTable[i]() | |
timerTable[i] = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function containerRayCast(a, b, mask, ...) | |
a = a[1] .. " " .. a[2] .. " " .. a[3] | |
b = b[1] .. " " .. b[2] .. " " .. b[3] | |
local result = con.containerRayCast(a, b, mask, ...) | |
if result == "0" then | |
return nil | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BytesReader(object): | |
def __init__(self, b): | |
self.bytes = b | |
self.cursor = 0 | |
def read(self, n=None): | |
c = self.cursor | |
if n == None: | |
self.cursor = len(self.bytes) |