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
| --[[ | |
| extload | |
| load an external folder | |
| ]] | |
| cd(env().path) | |
| local argv = env().argv | |
| if (#argv < 1) then | |
| print("\f6usage: load filename -- can be file or directory") |
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
| --- Loads an ini string into a lua table | |
| --- @param ini_text string | |
| --- @return table | |
| function load_ini(ini_text) | |
| local tbl = {} | |
| local lines = split(ini_text, "\n", false) | |
| local current_head = tbl | |
| local header = "" |
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
| 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 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
| 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 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
| #!/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 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
| --[[ 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 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
| #!/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 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
| picotron cartridge // www.picotron.net | |
| version 2 | |
| :: gfx/ | |
| :: gfx/0.gfx | |
| b64$LS1bW3BvZCxjcmVhdGVkPSIyMDI0LTAzLTE0IDIyOjM4OjMyIixtb2RpZmllZD0iMjAyNC0w | |
| My0xNCAyMzozMzozMCIscmV2aXNpb249MTYzXV1sejQAWQIAAHIzAADzFHtbMF09e2JtcD1weHUA | |
| QyAQEATw8CxmbGFncz0wLHBhbl94CADPeT0wLHpvb209OH0sMQAs3-8cIP8OIPcw-iD-HCBtAB1g | |
| ABcQB0AHBgBgAAcQByAHCAARAAYAAAwANBAXEAwAEBcGAAIEAP8KABdABzAX8AZ3QNcAR1CHcIdQ | |
| 9wUA10B3MH0AHlAYEAhACAYAYAAIEAggCAgAEQAGAAAMADQQGBAMABAYBgACBAD-CQAYQAgwGPAG |
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
| #!/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 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
| // ==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"); |
NewerOlder