Skip to content

Instantly share code, notes, and snippets.

View slashinfty's full-sized avatar

Matt Braddock slashinfty

View GitHub Profile
@slashinfty
slashinfty / inftyb0t-help.md
Last active July 11, 2020 16:59
Help document for my Twitch bot.

inftyb0t

Commands for everyone

!sml2 race

Get a random seed with common flags. Add +dx to the end if you want to race a DX seed.

!sml2 hard

@slashinfty
slashinfty / tex2pdf.bat
Last active December 27, 2019 03:17
A Windows batch file for simple LaTeX PDF compiling with clean up
rem this batch file compiles all tex files to pdf files in the folder this file is in
for %%i in (*.tex) do (if not exist "%%~ni.pdf" xelatex "%%i")
rem this will delete any extraneous files from the compilation process
del *.log && del *.aux
rem this will delete original tex files and leave only pdf files - delete rem below if you want to enable
rem del *.tex
@slashinfty
slashinfty / InputPianoRoll.lua
Last active April 13, 2023 10:58
Create a "piano roll" of inputs on BizHawk screen to right of GB game
local ScriptInfo = {"Input Piano Roll","by dadinfinitum","v0.2","28th Jul 2019",}
local inputobj = {[0]="Up","Down","Left","Right","Start","Select","B","A"}
local display = {Up="U",Down="D",Left="L",Right="R",Start="S",Select="s",B="B",A="A"}
function text(x,y,text,color)
gui.drawText(x,y,text,color,0x00000000,9,"Arial")
end
@slashinfty
slashinfty / roll.sh
Last active December 7, 2019 01:27
Shell script for rolling dice (#d#+#)
#! /bin/bash
if [[ $# -lt 1 ]]; then
echo "missing argument"
exit 1
fi
RANDOM=$$
roll=0
mod=0
while [[ $1 ]]
do
@slashinfty
slashinfty / .bash_stimer_alias
Last active July 9, 2023 15:55 — forked from lillesvin/shplit.sh
Command line split timer - set up as an alias to easily run - removed text pipe option due to poor performance with obs
#!/bin/bash
alias stimer='shplit'
function shplit() {
FORMAT="%s.%2N"
STARTTIME=$(date +${FORMAT})
function format_duration {
printf "%.2f" $1
}
@slashinfty
slashinfty / .bash_aliases
Last active March 17, 2020 14:46
Collection of various hacky bash functions
# quick apt commands
alias upd='sudo apt update && sudo apt list --upgradable'
alias upg='sudo apt upgrade -y && sudo apt autoremove -y'
alias ins='sudo apt install'
alias prg='sudo apt purge'
alias avail='apt policy'
# adding applications to dmenu
# first parameter: name of entry
# second parameter (for add): command to launch application
// ==UserScript==
// @name Giphy Download GIF
// @version 1.0.1
// @description Allows you to download GIFs direcly from GIPHY
// @author slashinfty (originally by Yoshitura)
// @match https://*.giphy.com/gifs/*
// @match http://*.giphy.com/gifs/*
// @grant none
// @run-at document-end
// ==/UserScript==
@slashinfty
slashinfty / copy-meet-chat.js
Last active April 21, 2020 03:00
Get a list of users who have sent a chat message in a Google Meet
// To run (in Chrome):
// MUST HAVE GOOGLE MEET CHAT VISIBLE!
// Press F12 to open Developer Tools
// Click the "Console" tab
// Copy and paste the code below
function copyToClipboard(str) {
var tempInput = document.createElement("input");
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
tempInput.value = str;
@slashinfty
slashinfty / racetime.js
Last active June 1, 2020 14:29
Are you in a racetime.gg race? (node.js)
const fetch = require('node-fetch');
module.exports = {
getLink: async function(client, channel) {
const siteRoot = 'https://racetime.gg';
const raceSearch = await fetch(`${siteRoot}/races/data`);
const races = await raceSearch.json();
if (races.races.length === 0) client.say(channel, 'No active races');
else {
let foundRace = null;
local i = 0
local cx = 0
local cy = 0
local p1_cx = 0
local p1_cy = 0
local p2_cx = 0
local p2_cy = 0
local drawn = 0
function drawTile(x, y)