Skip to content

Instantly share code, notes, and snippets.

@mekb-turtle
mekb-turtle / power
Last active September 8, 2023 02:45
rofi power menu script
#!/bin/bash
RES="$(rofi -dmenu -p "Power" <<< $'Shutdown\nRestart\nLog Out\nLock')"
if [[ "$RES" == "Shutdown" ]]; then /usr/local/sbin/do shutdown & disown; fi
if [[ "$RES" == "Restart" ]]; then /usr/local/sbin/do restart & disown; fi
if [[ "$RES" == "Log Out" ]]; then hyprctl dispatch exit; fi
if [[ "$RES" == "Lock" ]]; then swaylock; fi
#if [[ "$RES" == "Suspend" ]]; then swaylock & /usr/local/sbin/do suspend1 & disown; fi
@mekb-turtle
mekb-turtle / pacman-apt
Last active March 13, 2023 08:24
Pacman-like front-end for apt
#!/usr/bin/bash
ROOT_PROGRAM=(sudo)
APT=(apt)
function pacman-run-apt(){
"${APT[@]}" "$@"
}
function pacman-run-apt-with-root(){
IFS=
if [[ "$(id -u)" == "0" ]]; then
"${APT[@]}" "$@"
@mekb-turtle
mekb-turtle / liminetest.sh
Last active October 16, 2022 09:10
Test Limine configurations
#!/usr/bin/bash
DIR=/tmp/liminetest
ISO_DIR=$DIR/isoroot
ISO=$DIR/out.iso
LIMINE_CONFIG=limine.cfg
LIMINE_DIR=limine.d # for adding extra fonts and stuff
LIMINE_BIN_DIR=/usr/share/limine
mkdir -pv "$DIR/" "$ISO_DIR/" "$ISO_DIR/$LIMINE_DIR/" && \
cp -v "${1-/boot/$LIMINE_CONFIG}" "$ISO_DIR/$LIMINE_CONFIG" || exit "$?"
cp -vr "${2-/boot/$LIMINE_DIR}"/* "$ISO_DIR/$LIMINE_DIR/"
@mekb-turtle
mekb-turtle / colorbars.sh
Last active April 17, 2023 04:24
bash script to show terminal colors
#!/usr/bin/bash
if [[ "$TERM" == "linux" ]]; then
printf "%s" $'\x1b[48;5;0;38;5;15m 0 \x1b[48;5;1;38;5;15m 1 \x1b[48;5;2;38;5;15m 2 \x1b[48;5;3;38;5;15m 3 \x1b[48;5;4;38;5;15m 4 \x1b[48;5;5;38;5;15m 5 \x1b[48;5;6;38;5;15m 6 \x1b[48;5;7;38;5;15m 7 \x1b[0m\n'
printf "%s" $'\x1b[48;5;0;38;5;15m 8 \x1b[48;5;1;38;5;15m 9 \x1b[48;5;2;38;5;15m10 \x1b[48;5;3;38;5;15m11 \x1b[48;5;4;38;5;15m12 \x1b[48;5;5;38;5;15m13 \x1b[48;5;6;38;5;15m14 \x1b[48;5;7;38;5;15m15 \x1b[0m\n'
else
printf "%s" $'\x1b[48;5;0;38;5;255m 0 \x1b[48;5;1;38;5;255m 1 \x1b[48;5;2;38;5;255m 2 \x1b[48;5;3;38;5;255m 3 \x1b[48;5;4;38;5;255m 4 \x1b[48;5;5;38;5;255m 5 \x1b[48;5;6;38;5;255m 6 \x1b[48;5;7;38;5;16m 7 \x1b[0m\n'
printf "%s" $'\x1b[48;5;8;38;5;255m 8 \x1b[48;5;9;38;5;16m 9 \x1b[48;5;10;38;5;16m10 \x1b[48;5;11;38;5;16m11 \x1b[48;5;12;38;5;16m12 \x1b[48;5;13;38;5;16m13 \x1b[48;5;14;38;5;16m14 \x1b[48;5;15;38;5;16m15 \x1b[0m\n'
printf "%s" $'\n'
for m in {0..5}; do
for l in {0..5}; do
@amishshah
amishshah / discordjs.md
Created October 22, 2021 22:36
tl;dr i'm stepping down as owner of discord.js!

Hello! I'm Amish (also known as hydrabolt), and I am the creator of discord.js.

I created discord.js as a hobby/learning project for myself in August 2015 while I was still a teenager in school.

More than 6 years later, discord.js has become more popular than I could ever imagine, and I cannot express how grateful I am to the other contributors and the community for this amazing experience.

A few of my favourite highlights include:

  • The countless voice rewrites (I think we're done with that now 😉)
  • The April Fools' traditions
@m-Phoenix852
m-Phoenix852 / index.user.js
Last active May 3, 2024 05:09
Userscript to login to discord accounts with ease, just do SHIFT + T at the login page and enter the token!
// ==UserScript==
// @name Discord Token Login
// @namespace https://gist.github.com/m-Phoenix852/d63d869f16e40dac623c9aa347e8641a/
// @version 1.1
// @description Taking over discord's tokens!
// @author Phoenix852
// @match *://discord.com/login
// @updateURL https://gist.github.com/m-Phoenix852/d63d869f16e40dac623c9aa347e8641a/raw/6d1ee63df17685e4ea06018bd8b47541d4261b82/index.user.js
// @grant none
// @iconURL https://i.imgur.com/rI8GsTz.png
@m-Phoenix852
m-Phoenix852 / discord-token-logger.js
Created August 26, 2020 07:45
Simple script to log in to discord account using token.
let token = "your token";
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
@LnLcFlx
LnLcFlx / archlogo.txt
Last active March 7, 2024 20:08
Arch Linux logo using unicode block characters
\033[38;2;23;147;209m ▄
▟█▙
▟███▙
▟█████▙
▟███████▙
▂▔▀▜██████▙
▟██▅▂▝▜█████▙
▟█████████████▙
▟███████████████▙
▟█████████████████▙
@eyecatchup
eyecatchup / js-generator-functions.md
Last active July 23, 2019 10:08
Creating a `GeneratorFunction` in JavaScript

Generator defined using the function* statement syntax:

// function *idMaker(){ <- also possible, even though no reference found
function* idMaker(){
  var index = 0;
  while(index < index+1)
    yield index++;
}
@PixelSergey
PixelSergey / dump.md
Last active April 24, 2024 17:08
Dump games with godmode9

Dumping games with Godmode9

Dumping games is the act of taking a game from your system or gamecart and copying it into a readable format onto your SD card. Dumping is perfectly legal if you keep the dumps to yourself, however sharing these dumps is piracy and is illegal.

This guide will tell you how to dump games from various formats and for various purposes. Dumping 3DS cartriges as .cia files is good if you want to install them to your system. Dumping them as .3ds files is good for emulators. Installed titles cannot be dumped as .3ds files. NDS cartiges can only be dumped as .nds files and cannot be installed (however, you can play them with emulators or flashcarts).

Dumping the RomFS of a game is primarily for romhacking purposess.