Skip to content

Instantly share code, notes, and snippets.

Avatar

Fingercomp Fingercomp

View GitHub Profile
View crash.lua
local shell = require("shell")
local fs = require("filesystem")
local args = {...}
local elog = shell.resolve(table.remove(args, 1))
local path = shell.resolve(table.remove(args, 1))
if not elog or not path then
print("USAGE: crash <error log path> <path to program> [arguments...]")
return 1
@Fingercomp
Fingercomp / https-oc-compat.lua
Created Aug 16, 2016
Luascket's https ⟷ OC http libraries compatibility layer
View https-oc-compat.lua
local ltn12 = require("ltn12")
local http = require("http")
local https = {
request = function(params)
local body = nil
if params.source then
body = ""
for chunk in params.source do
body = body .. chunk
View x509v3-certificate-structure.txt
Certificate = SEQUENCE {
tbsCertificate = TBSCertificate = SEQUENCE {
version = EXPLICIT (Version = INTEGER {v1(0), v2(0), v3(2)}) DEFAULT v1,
serialNumber = CertificateSerialNumber = INTEGER,
signature = AlgorithmIdentifier = SEQUENCE {
algorithm = OBJECT IDENTIFIER,
parameters = ANY DEFINED BY algorithm OPTIONAL
},
issuer = Name = CHOICE {
-- only one possibility for now --
View progress-bars.txt
2.999 G / 2.999 G▕ ▏ 0.00% -- 10.00 k/s 02:50:00
9999 B / 9999 B▕██████████ ▏ 50.00% -- 10.00 k/s 00:59:59
10.00 k / 10.00 k▕██████████▏ ▏ 50.12% -- 10.00 k/s 55:59
99.99 k / 99.99 k▕██████████▎ ▏ 50.25% -- 99.99 k/s 10:00
100.0 k / 100.0 k▕██████████▍ ▏ 50.37% -- 100.0 k/s 09:59
999.9 k / 999.9 k▕██████████▌ ▏ 50.50% -- 999.9 k/s 01:30
1.000 G / 1.000 M▕██████████▋ ▏ 50.62% -- 1.000 G/s 00:05
9.999 G / 9.999 M▕██████████▊ ▏ 50.75% -- 9.999 G/s 00:00
10.00 G / 10.00 G▕██████████▉ ▏ 50.87% -- 10.00 G/s 2d, 22:22:22
99.99 G / 99.99 G▕███████████ ▏ 51.00% -- 99.99 G/s 9999d, 11:11:11
@Fingercomp
Fingercomp / nn.lua
Last active Jul 3, 2020
OpenComputers Nanomachines control program [Minecraft]
View nn.lua
local CONF = "/etc/nn.conf"
local m = require("component").modem
local event = require("event")
local ser = require("serialization")
local fs = require("filesystem")
local unicode = require("unicode")
_G.port = _G.port or 27091
_G.max = _G.max or 15
_G.effects = _G.effects or {}
@Fingercomp
Fingercomp / lamp.lua
Created Nov 12, 2015
Lamp-o-mat. Controls CX lamps using OC computer [Minecraft]
View lamp.lua
-- Lamp-o-mat. Controls CX lamps using OC computer. Minecraft. --
global_lamps = {"cf0", "95c", "ad9", "a1a", "d97", "afb", "cc5", "335", "a75"}
global_exit = false
local com = require("component")
local event = require("event")
base = {__index = base}
function base.__call(self, count)
if not global_exit then
count = count or math.huge