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
function pretty_printh(s) | |
s = s | |
:gsub("%[fg=(#?%w+)]", function (c) | |
if c:find("^%d+$") then | |
return string.format("\27[38;5;%sm", c) | |
end | |
if c:find("^#[%da-fA-F][%da-fA-F][%da-fA-F][%da-fA-F][%da-fA-F][%da-fA-F]$") then | |
return string.format( | |
"\27[38;2;%d;%d;%dm", |
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
function move_towards(x, y) | |
if abs(x - y) < s then | |
return y | |
elseif x > y then | |
return x - s | |
elseif x < y then | |
return x + s | |
end | |
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
#!/bin/bash | |
# if inside a tmux session, don't do anything | |
if [ -z "$TMUX" ]; then | |
# get the session name of the first session that isn't attached | |
FREE_SESSION=$(tmux ls 2>/dev/null | grep -v "(attached)$" | cut -f1 -d: | head -n 1) | |
# if no free sessions, make a new one | |
# otherwise attach to it | |
if [ -z "$FREE_SESSION" ]; then | |
tmux new && exit | |
else |
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
--[[ json.lua | |
A compact pure-Lua JSON library. | |
The main functions are: json.stringify, json.parse. | |
## json.stringify: | |
This expects the following to be true of any tables being encoded: | |
* They only have string or number keys. Number keys must be represented as | |
strings in json; this is part of the json spec. |
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
#!/usr/bin/env python3 | |
from textwrap import wrap | |
import requests | |
from markdownify import markdownify | |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route("/statuses") |
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
picotron cartridge // www.picotron.net | |
version 2 | |
:: gfx/ | |
:: gfx/0.gfx | |
b64$LS1bW3BvZCxjcmVhdGVkPSIyMDI0LTAzLTE0IDIyOjM4OjMyIixtb2RpZmllZD0iMjAyNC0w | |
My0xNCAyMzozMzozMCIscmV2aXNpb249MTYzXV1sejQAWQIAAHIzAADzFHtbMF09e2JtcD1weHUA | |
QyAQEATw8CxmbGFncz0wLHBhbl94CADPeT0wLHpvb209OH0sMQAs3-8cIP8OIPcw-iD-HCBtAB1g | |
ABcQB0AHBgBgAAcQByAHCAARAAYAAAwANBAXEAwAEBcGAAIEAP8KABdABzAX8AZ3QNcAR1CHcIdQ | |
9wUA10B3MH0AHlAYEAhACAYAYAAIEAggCAgAEQAGAAAMADQQGBAMABAYBgACBAD-CQAYQAgwGPAG |
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
#!/bin/bash | |
WALLPAPER_PATH=$HOME/Pictures/Wallpapers/Shuffle | |
WALLPAPER=$(find "$WALLPAPER_PATH" -type f -name "*.jpg" -o -name "*.png" | shuf -n 1) | |
gsettings set org.gnome.desktop.background picture-uri "file://$WALLPAPER" |
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
// ==UserScript== | |
// @name Old Reddit Redirect | |
// @namespace Violentmonkey Scripts | |
// @match https://www.reddit.com/* | |
// @grant none | |
// @version 1.0 | |
// @author Arnaught | |
// @description 8/27/2023, 11:06:35 AM | |
// ==/UserScript== | |
location.href = location.href.replace("www", "old"); |
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
#!/bin/bash | |
# get all files on remote site, remove coloring, and sort | |
NEOCITIES_FILES=$(neocities list -a | ansi2txt | sort) | |
# echo "$NEOCITIES_FILES" | |
# get all files from local site, remove _site/ prefix, remove / suffix, remove blank lines, and sort | |
LOCAL_FILES=$(find _site/ | sed -e 's/^_site\///' -e 's/\/$//' -e '/^$/d' | sort) | |
# echo "$LOCAL_FILES" | |
# compare two lists |
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
// ==UserScript== | |
// @name Kbin Instance Display | |
// @namespace Violentmonkey Scripts | |
// @match https://kbin.social/* | |
// @grant none | |
// @version 1.0 | |
// @author Arnaught | |
// @description Displays instance name next to users on remote instances | |
// ==/UserScript== | |
[...document.querySelectorAll(".user-inline")].forEach(item => { |
NewerOlder