Skip to content

Instantly share code, notes, and snippets.

@ricewind012
ricewind012 / a.js
Created March 15, 2025 08:02
some firefox mpd ctypes shit, does this even work lmaooo
mpd_settings = new ctypes.StructType("mpd_settings", [
{ host: ctypes.char.ptr },
{ port: ctypes.unsigned },
{ timeout_ms: ctypes.unsigned },
{ password: ctypes.char.ptr },
]);
mpd_audio_format = new ctypes.StructType("mpd_audio_format", [
{ sample_rate: ctypes.uint32_t },
{ bits: ctypes.uint8_t },
@ricewind012
ricewind012 / a.js
Created March 15, 2025 07:58
some awesomewm jsdoc generator
(() => {
const surround = (node) => {
const text = node.textContent.replace(/\n/g, "").trim();
switch (node.nodeName) {
case "A":
return `[${text}](${node.href})`;
case "CODE":
return `\`${text}\``;
case "EM":
return `_${text}_`;
@ricewind012
ricewind012 / .bashrc
Last active January 7, 2025 12:58
windows letters prompt with /etc/fstab support
# Have to rerun every time /etc/fstab gets changed
XDG_CACHE_HOME=${XDG_CACHE_HOME:=$HOME/.cache}
win_script=$XDG_CACHE_HOME/win_dirs_cached
[[ -f $win_script ]] || win_dirs > "$win_script"
. "$win_script"
get_win_prompt() {
local found=0
for key in "${!win_dirs[@]}"; do
[[ ! $PWD =~ ${win_dirs[$key]} ]] && continue
// ==UserScript==
// @name Create a panel
// @description yes
// @author me
// @include main
// ==/UserScript==
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
PanelMultiView: "resource:///modules/PanelMultiView.sys.mjs",
@ricewind012
ricewind012 / a.js
Last active June 11, 2024 20:09
restore normal classes
class CClassDeminifier {
constructor() {
this.m_bInClient = !!window.SteamClient?.User;
this.m_strWebpackGlobal = Object.keys(window).find(
(e) => e.startsWith("webpackChunk") && e !== "webpackChunklegacy_web",
);
this.m_vecModules = [];
this.k_unDelay = 1.5;
this.k_vecWebSelectors = [
/* ==UserStyle==
@name Motif-style scrollbars
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author Me
@preprocessor stylus
==/UserStyle== */
@-moz-document domain("4channel.org"), domain("4chan.org") {