This file contains hidden or 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
include "/usr/share/X11/locale/en_US.UTF-8/Compose" | |
# IPA | |
<Multi_key> <i> <g> <s> : "ʔ" | |
<Multi_key> <i> <s> <h> : "ʃ" | |
<Multi_key> <i> <j> : "ʒ" | |
<Multi_key> <i> <t> <h> : "θ" | |
<Multi_key> <i> <v> <t> <h> : "ð" | |
<Multi_key> <i> <f> <r> : "ɾ" | |
<Multi_key> <i> <d> <c> : "ǀ" |
This file contains hidden or 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 str = 'Test.wat#hi[a[1]=2] Child, Other' | |
local function clone(t, m) | |
m = m or {} | |
if m[t] then | |
return m[t] | |
elseif type(t) == 'table' then | |
local r = {} | |
m[t] = r | |
for k, v in pairs(t) do |
This file contains hidden or 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
-- or maybe `metamethod` | |
instance Add Ratio where | |
add (Ratio x1 y1) (Ratio x2 y2) = Ratio ((x1 * y2) + (x2 * y1)) (y1 * y2) |
This file contains hidden or 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 formArguments( class, target ) | |
local reg = class:getRegistry() | |
local constructor, alias, args = reg.constructor, reg.alias, target.arguments | |
local returnArguments, trailingTable = {n=0;}, {} | |
if not constructor then return nil end | |
local argumentTypes = constructor.argumentTypes | |
local ordered, set, target = constructor.orderedArguments, {} | |
for i = 1, #ordered do |
This file contains hidden or 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 VFS = { | |
['test'] = 'hello?\nwho\'s there?'; | |
} | |
VFS_ENV.fs = setmetatable({}, { __index = fs }) | |
function VFS_ENV.fs.open(path, mode) | |
local handle = {} | |
if mode == 'r' then | |
if VFS[path] then | |
local data = VFS[path] |
This file contains hidden or 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
-- outside is a ResourceContext for outside the application | |
-- inside is a ResourceContext for the application bundle | |
-- all these are bundled | |
local img = ImageParser.parse(inside.get('test-image.whatever-extension-here')) | |
local masterTheme = Theme.fromFile(inside.get('ui/master.theme')) | |
local layout = Layout.fromFile(inside.get('ui/master.tml')) | |
-- this is bundled | |
local api = CCAPI.load(inside.get('api'), outside) |
This file contains hidden or 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 VFS_ENV = setmetatable({ | |
TEST_VAR = "TEST_VAR_VALUE"; | |
}, {__index = _ENV or getfenv()}) | |
VFS_ENV._G = VFS_ENV | |
VFS_ENV._ENV = VFS_ENV | |
function VFS_ENV.load(src, name, mode, env) | |
return load(src, name or '(load)', mode, env or VFS_ENV) | |
end |
This file contains hidden or 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 pull(c) | |
if coroutine.status(c) == 'dead' then | |
return false | |
else | |
local ok, res = coroutine.resume(c) | |
if coroutine.status(c) == 'dead' then | |
return false | |
elseif ok then | |
return true, res | |
else |
This file contains hidden or 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
def subsets(s, n, l): | |
if len(s) == 0 and n == 0: | |
l.append([]) | |
return | |
if len(s) == 0: | |
return | |
h, *t = s |
This file contains hidden or 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
supervise([ | |
worker(Buffer, []), | |
supervisor(Modes, [buffer_pid]) | |
], strategy: :one_for_one) |