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
import * as ts from "typescript"; | |
import * as tstl from "@jackmacwindows/typescript-to-lua"; | |
const EXPECT_PLUGIN = "cc.expect"; | |
const EXPECT_METHOD = "expect"; | |
const EXPECT_FUNCTION = "___TS_Expect"; | |
function fillTypeList(args: ts.Expression[], type: ts.TypeNode, context: tstl.TransformationContext): boolean { | |
if (ts.isUnionTypeNode(type)) { | |
for (let t of type.types) if (!fillTypeList(args, t, context)) return false; |
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 M6502 = require "M6502" -- https://gist.github.com/MCJack123/cf500b62fdbcb135d2db6cf97a771c6e | |
local SID = require "sid" -- https://gist.github.com/MCJack123/d076bfcab67767cef6fd0292655e03ae | |
term.clear() | |
term.setCursorPos(1, 1) | |
local win = window.create(term.current(), 38, 1, 14, 10) | |
win.clear() | |
local status = window.create(term.current(), 1, 1, 37, 19) | |
local oldterm = term.redirect(status) | |
local ok, err = pcall(function(...) |
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 M6502 = require "M6502" | |
local nsongs = 1 | |
local defaultsong = 0 | |
local stereo = false | |
local ntsc = false | |
local type = 0 -- 0 = B, 1 = C, 2 = D, 3 = S, 4 = R | |
local fastplay = 312 | |
local initaddr = 0x0000 | |
local musicaddr = 0x0000 |
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
------------------------------------------------------------------------------- | |
-- This file is reSID, a MOS6581 SID emulator engine, ported to Lua. | |
-- Copyright (C) 2004 Dag Lem <resid@nimrod.no> | |
-- Lua port Copyright (C) 2023 JackMacWindows <jackmacwindowslinux@gmail.com> | |
-- | |
-- This program is free software; you can redistribute it and/or modify | |
-- it under the terms of the GNU General Public License as published by | |
-- the Free Software Foundation; either version 2 of the License, or | |
-- (at your option) any later version. | |
-- |
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
-- MIT License | |
-- | |
-- Copyright (c) 2018-2022 JackMacWindows | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal | |
-- in the Software without restriction, including without limitation the rights | |
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-- copies of the Software, and to permit persons to whom the Software is | |
-- furnished to do so, subject to the following conditions: |
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
-- MIT License | |
-- | |
-- Copyright (c) 2023 JackMacWindows | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal | |
-- in the Software without restriction, including without limitation the rights | |
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-- copies of the Software, and to permit persons to whom the Software is | |
-- furnished to do so, subject to the following conditions: |
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
-- Licensed as CC0 | |
local expect = dofile "/rom/modules/main/cc/expect.lua" | |
local function splitPath(p) | |
local retval = {} | |
for m in p:gmatch("[^/]+") do table.insert(retval, m) end | |
return retval | |
end | |
local function aux_find(parts, p) |
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: aoc2022 <day>-<1|2> [local] | |
-- Run `set aoc.session <session token>` before running | |
local aoc = {} | |
local function run(n, l) | |
local f = aoc[n] | |
local file | |
if l then file = fs.open("aoc.txt", "r") | |
else file = http.get("https://adventofcode.com/2022/day/" .. n:match("^%d+") .. "/input", {Cookie = "session=" .. settings.get("aoc.session")}) end | |
local start = os.epoch "utc" | |
local r = tostring(f(file)) |
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 A, | |
B,z,b,S,C,F,r= | |
0,0,{},{},math.sin | |
,math.cos,math.floor,{ | |
}for c in([[0123456789ab | |
]]):gmatch"%S"do r[#r+1]=c | |
end term.clear()for i=0,11-- | |
do term.setPaletteColor(2^i,i/ | |
11,i/18,i/21)end while""do for | |
n=0,1759 do b[n], z[n]=" ",0 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
// Usage: node gh-lang-count.mjs <user> [PAK] | |
import * as process from 'process'; | |
if (!global.fetch) throw new Error("This requires NodeJS 17.5.0 or later."); | |
if (process.argv.length < 3) throw new Error("Usage: gh-lang-count <user> [PAK]"); | |
const username = process.argv[2]; | |
let key = undefined; | |
if (process.argv.length > 3) key = "token " + process.argv[3]; | |
async function main() { |