Skip to content

Instantly share code, notes, and snippets.

@littletsu
littletsu / egg.lua
Created January 30, 2024 07:40
Proof of Concept State machine for Roblox simulator egg hatching
local StateMachine = {}
export type StateMachine = typeof(StateMachine.new())
export type StateMachineEnterCallback = (previousState: string|nil) -> ()
export type StateMachineState = {
Enter: StateMachineEnterCallback?,
Exit: ((nextState: string|nil) -> ())?,
Name: string?
}
@littletsu
littletsu / userscript.js
Created December 31, 2023 00:49
Better titles for FFmpeg doxygen
// ==UserScript==
// @name Better titles for FFmpeg doxygen
// @namespace Violentmonkey Scripts
// @match https://ffmpeg.org/doxygen/*
// @grant none
// @version 1.0
// @author -
// @description 12/30/2023, 2:32:16 AM
// ==/UserScript==
(() => {
@littletsu
littletsu / config
Last active December 14, 2022 18:51
i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
@littletsu
littletsu / config
Last active August 28, 2022 05:36
Sway config
# Default config for sway
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
### Variables
#
# Logo key. Use Mod1 for Alt.
set $mod Mod1
@littletsu
littletsu / fonts.sh
Last active December 14, 2022 06:29
fonts
doas pacman --needed -S terminus-font ttf-croscore ttf-dejavu gnu-free-fonts ttf-liberation libertinus-font noto-fonts adobe-source-code-pro-fonts cantarell-fonts ttf-opensans noto-fonts-cjk noto-fonts-emoji ttf-jetbrains-mono
# Terminal: JetBrains Mono Regular 14.0
@littletsu
littletsu / download.js
Created February 19, 2022 09:01
Bulk Download Urls in Node.js
import fs from 'fs';
import fetch from 'node-fetch';
// urls.txt should be a text file containing the urls separated by a new line
const file = fs.readFileSync('./urls.txt', {'encoding': 'utf8'}).split('\n');
file.forEach(url => {
fetch(url).then(res => {
// modify to whichever format the downloads are
let write = fs.createWriteStream(`./urls/${Date.now()}.webp`);
@littletsu
littletsu / download.js
Created February 19, 2022 09:00
Bulk Download Urls in Node.js
import fs from 'fs';
import fetch from 'node-fetch';
// urls.txt should be a text file containing the urls separated by a new line
const file = fs.readFileSync('./urls.txt', {'encoding': 'utf8'}).split('\n');
file.forEach(url => {
fetch(url).then(res => {
// modify to whichever format the downloads are
let write = fs.createWriteStream(`./urls/${Date.now()}.webp`);
@littletsu
littletsu / dunstrc
Created January 12, 2022 02:38
personal dunst config
# See dunst(5) for all configuration options
[global]
### Display ###
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
@littletsu
littletsu / picom.conf
Last active August 28, 2022 05:35
personal picom.conf based on a minimal configuration
#################################
# Shadows #
#################################
# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# shadow = false
@littletsu
littletsu / hydraviz.js
Created January 9, 2022 03:49
Hydra visualizer
// credits to Asdrúbal Gomez for initial code snippet
noise(3,0.1,7)
.rotate(1,-1,-2).mask(shape(() => a.fft[4]*2 || 20))
.colorama(() => a.fft[0]*3 || 1)
.modulateScale(o0)
.modulateScale(o0,1,)
.scale(() => a.fft[3]*2 || 1)
.blend(o0)
.blend(o0)