Skip to content

Instantly share code, notes, and snippets.

View hugeblank's full-sized avatar
🥯
Be not square

Todd hugeblank

🥯
Be not square
View GitHub Profile
@hugeblank
hugeblank / 01_shatter.lua
Created January 9, 2023 22:02
Demo Shatter Startup script
local shatter = require("shatter") -- Load the shatter API
local mods = peripheral.wrap("back") -- get the modules list
if not mods.canvas then -- ensure glasses are present
error("Overlay Glasses required") -- error if they aren't there
end
_G.glasses, handler = shatter(mods.canvas()) -- get the terminal object, and put it in the global scope (for alpha setting [and more!] in the shell)
parallel.waitForAll(handler, -- put the handler function in parallel
function()
term.redirect(glasses) -- redirect to overlay
glasses.setBackgroundAlpha(.4) -- set the alpha value of the background to .4, for visibility.
@hugeblank
hugeblank / tiktok.sh
Last active December 31, 2023 23:09
Tiktok speech to text parser
#!/bin/zsh
# Tiktok speech to text parser
# by hugeblank, April 2022
# API endpoint & oneshot reading and playing discovered by @scanlime
# https://twitter.com/scanlime/status/1512288857596653568
# First argument - string of text to read
# Second argument - voice to use
# Usage examples:
@hugeblank
hugeblank / battery.sh
Last active February 7, 2022 11:19
Simple Script using Sapd/HeadsetControl to check the battery % and print it in a little bit more stylish manner
#!/bin/zsh
echo 🎧 `headsetcontrol -b | grep "Battery:" | awk {'printf $2'}`
@hugeblank
hugeblank / gnome-shell
Created November 7, 2021 14:47
gnome-shell.css hack for the green dark orchis theme
/* This stylesheet is generated, DO NOT EDIT */
/* Copyright 2009, 2015 Red Hat, Inc.
*
* Portions adapted from Mx's data/style/default.css
* Copyright 2009 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU Lesser General Public License,
* version 2.1, as published by the Free Software Foundation.
*
@hugeblank
hugeblank / raisin.lua
Created December 20, 2020 14:16
raisin 4.0-pre.0 with the thread demo program
--[[ Raisin by Hugeblank
This code is my property, but I will let you use it so long as you don't redistribute this manager for
monetary gain and leave this comment block untouched. Add/remove code as you wish. Should you decide to freely
distribute with additional modifications, please credit yourself. :)
Raisin can be found on github at:
`https://github.com/hugeblank/raisin`
Demonstrations of the library can also be found at:
`https://github.com/hugeblank/raisin-demos`
@hugeblank
hugeblank / allium-deps.ltn
Last active May 2, 2019 08:57
Allium dependency list designed for Depman
{
{
source = "https://raw.githubusercontent.com/hugeblank/raisin/master/raisin.lua",
path = "raisin.lua",
versions = {
">= 0.2.0",
}
},
{
source = "https://raw.githubusercontent.com/hugeblank/qs-cc/377de7135a291a9a3b79e01034432389295f45b9/src/allium/color.lua",
@hugeblank
hugeblank / interdemo.lua
Created April 21, 2019 20:13
Demo program for the interactable API I'm working on. It's pretty easy to work with!
local element = require("interactables") -- This is the backbone of this program
local text = "Click me!" -- Text to place on button
local cbuddon = element.button(5, 5, #text+2, 3) -- Create a button element
local function render(sel, lock) -- Rendering function
if lock then -- If it is locked gray it out
paintutils.drawFilledBox(5, 5, #text+6, 7, colors.gray)
elseif sel then -- Otherwise if it's selected make it bright
paintutils.drawFilledBox(5, 5, #text+6, 7, colors.lime)
else -- Otherwise make it dark
@hugeblank
hugeblank / interactables.lua
Last active April 21, 2019 20:12
Is this useful? Am I crazy? Tell me please I must know
local this = {}
local function base()
-- Base instance declaration, a template for all elements
local inst = {links = {}, object = {}} -- Template for all interactable elements
inst.object.link = function(...) -- Base and universal function for adding links
local l = {...} -- pack all links given
for i = 1, #l do -- For each link
inst.links[#inst.links+1] = l[i] -- Subscribe it to any emission we provide
end
@hugeblank
hugeblank / depman-rfc.lua
Last active May 1, 2019 07:55
Temporary gist so I have a chance to better the mess that is this code. Flame broil it!
--[[ Depman by hugeblank
Simple and free to use dependency managment framework to be packaged with your software.
The end user is not only allowed to modify the code below, but is encouraged to.
Please do not modify this comment block, but do credit yourself and any other
contributors in the box below.
]]
--[[ Depman Instance Information
Maintained by:
Modified for:
@hugeblank
hugeblank / dep-test.ltn
Last active May 1, 2019 07:10
Felt cute, might delete later.
{
{
source = "https://raw.github.com/hugeblank/raisin/0c71e68ee0b228ba2aa33dc9918f05e10d6e1092/raisin.lua",
path = "raisin.lua",
versions = {
"0.0.0",
"0.0.1-test"
}
},
{