Skip to content

Instantly share code, notes, and snippets.

View littletsu's full-sized avatar

Lucia Luna littletsu

View GitHub Profile
@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)
@littletsu
littletsu / .xinitrc
Last active December 14, 2022 06:27
personal xinitrc
# x funny
xset led named 'Scroll Lock'
# pipewire
pipewire&
pipewire-pulse&
sleep 2 # delay to ensure pipewire has started
wireplumber&
@littletsu
littletsu / .zshrc
Last active April 27, 2022 19:39
personal zshrc aliases
alias sudo='doas'
alias sudoedit='doas rnano'
# only for arch repos
alias mirror='doas reflector --protocol https --latest 50 --number 20 --sort rate --save /etc/pacman.d/mirrorlist'
# Enable wayland for firefox
#export MOZ_ENABLE_WAYLAND=1
alias pls='doas $(fc -ln -1)'
# fix npm update
alias fixnpm='doas pacman -S npm --overwrite "/usr/lib/node_modules/npm/*"'
@littletsu
littletsu / pd_bindings.tcl
Created October 9, 2021 04:35
Pure Data Toggle DSP Hotkey
# add this before global hotkeys are defined
# then replace or add the desired toggle dsp hotkey with ::pd_bindings::toggle_dsp
# example: "bind_capslock all $::modifier-Key w {::pd_bindings::toggle_dsp}"
# (replacing CTRL-W Exit hotkey with toggle dsp)
set ::pd_bindings::dsp_on false
proc ::pd_bindings::toggle_dsp {} {
if {$::pd_bindings::dsp_on} {
pdsend "pd dsp 0"
@littletsu
littletsu / main.cc
Last active July 4, 2020 22:13
Probably Working With All Programs SendInput
INPUT ip = {0};
ip.type = INPUT_KEYBOARD;
ip.ki.wScan = 0x39; // hardware scan code for key (http://www.philipstorr.id.au/pcbook/book3/scancode.htm)
ip.ki.dwFlags = KEYEVENTF_SCANCODE;
SendInput(1, &ip, sizeof(INPUT));
ip.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
SendInput(1, &ip, sizeof(INPUT));
@littletsu
littletsu / Cargo.toml
Created August 8, 2019 03:23
SendInput with Rust WinAPI crate (not for actual use in a serious rust program, just an example)
[package]
name = "sendinputexample"
version = "0.1.0"
authors = ["Dayaa <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
winapi = { version = "0.3.7", features = ["winuser"] }
@littletsu
littletsu / tablas.js
Last active November 22, 2018 02:30
Tablas de Multiplicar en JavaScript (Funciona en Node.js y Navegador)
// Variables
let tabla = 2
let longitud = 10
// Codigo
for (i = 1; i < longitud + 1; i++) {
console.log(`${tabla}x${i} = ${tabla*i}`)
}