Skip to content

Instantly share code, notes, and snippets.

View Efreak's full-sized avatar
😴
😪😴🥱😌💤

Efreak Efreak

😴
😪😴🥱😌💤
View GitHub Profile
@JySzE
JySzE / mpv.conf
Last active July 22, 2025 21:58
JySzE MPV Config
# Version 3.1
# 07/22/2025
###############################################################################################################################################
# Player GUI Options
###############################################################################################################################################
# Adjust all as needed.
@daveschumaker
daveschumaker / prompt_expansion.js
Created January 12, 2024 06:09
Poor Man's Prompt Expansion for Stable Diffusion
/**
* Various Stable Diffusion models massively benefit from prompt descriptions that contain
* additional descriptors. Much recent research has gone into training text generation models for
* expanding existing Stable Diffusion prompts with relevant and context appropriate descriptors.
*
* Since it isn't feasible to run LLMs and text generation models inside most users' web browsers
* at this time, I present my "Poor Man's Prompt Expansion Model". It uses a number of examples
* I've acquired from Fooocus and Hugging Face to generate completely random
* (though not context appropriate) prompt expansions.
*/
@Dan-Q
Dan-Q / _no_code_page_.php
Last active October 12, 2024 16:49
Hacky PHP to produce a "blank" web page which somehow has content when viewed in Firefox. Sample page at https://danq.me/wp-content/no-code-webpage/, explanation at https://danq.me/nocode
<?php
// half-hearted CSS minification
$css = preg_replace(
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'),
array('$1{ ','$1$3;',"",'} '),
file_get_contents('linked.css')
);
// embed as a data: uri
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '=');
@lucsoft
lucsoft / GnomeNested.sh
Last active July 2, 2025 05:52 — forked from davidedmundson/PlasmaNested.sh
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
# Fetch Resolution
RES=$(xdpyinfo | awk '/dimensions/{print $2}')
# Apply Resolution in env and start a new nested gnome with a new dbus
env MUTTER_DEBUG_DUMMY_MODE_SPECS=$RES dbus-run-session -- gnome-shell --wayland --nested
@davidedmundson
davidedmundson / PlasmaNested.sh
Last active June 14, 2025 02:47
Run plasma from within gamescope
#!/bin/sh
# Remove the performance overlay, it meddles with some tasks
unset LD_PRELOAD
## Shadow kwin_wayland_wrapper so that we can pass args to kwin wrapper
## whilst being launched by plasma-session
mkdir $XDG_RUNTIME_DIR/nested_plasma -p
cat <<EOF > $XDG_RUNTIME_DIR/nested_plasma/kwin_wayland_wrapper
#!/bin/sh
@Efreak
Efreak / cargo-csearch.bsh
Last active January 9, 2022 18:25
list packages installed via cargo with colored columns for package name, version, and installed binaries
#!/usr/bin/env bash
if [ "$1" = "csearch" ]; then shift; fi #remove subcommand if called via `cargo csearch`
c33=$'\033[33m'
c34=$'\033[34m'
c35=$'\033[35m'
c0=$'\033[0m'
list="$(cargo search $@)"
@garbled1
garbled1 / build_cbz.sh
Created October 28, 2020 15:17
Download webcomics with dosage into CBZ files nightly. Uses to_cbz and dosage
#!/bin/bash
source ~/venv/bin/activate
rm /comics/download/WebToons/*/complete.txt
dosage -b /comics/download -c @
COMIC_DL=/comics/download
COMIC_CBZ=/comics/cbz
COMIC_TMP=/comics/tmp
@rrrnld
rrrnld / airsonic.fish
Last active October 22, 2020 23:36
A simple command-line wrapper for interacting with the airsonic api. 🎧 Needs https://fishshell.com/ and https://httpie.org/.
#!/usr/bin/env fish
# Put this in your .config/fish/functions folder and you'll get an `airsonic`
# command that you can use to interact with the rest api. If you just want to
# play around with it, you can execute it directly.
function _airsonic_usage
echo 'Usage: airsonic [-h|--help] -u $user -p $pass [$url] $endpoint [...$params]'
echo
echo 'Interact with an airsonic server via REST. See http://www.subsonic.org/pages/api.jsp for additional documentation.'
@rektdeckard
rektdeckard / drawable-tool.sh
Last active May 17, 2022 02:59
A suite of bash scripts for Android icon pack creators. Generate drawable.xml and icon-pack.xml from directory of icons, and map appfilter.xml to the other filter file formats.
#!/bin/bash
## Drawable Tool
## created 2019.6.15
## updated 2019.7.20
## author Tobias Fried <[email protected]>
## A bash script for Android Icon Pack creators
## Create a list of drawable resources (PNGs) in the specified directory, in the format required for your drawable.xml
DRAWABLE="drawable.xml"
@cerebrate
cerebrate / README.md
Last active July 4, 2025 01:28
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE