Skip to content

Instantly share code, notes, and snippets.

View remixer-dec's full-sized avatar
☮️
make software, not war

Remixer Dec remixer-dec

☮️
make software, not war
View GitHub Profile
@remixer-dec
remixer-dec / ytsort.js
Last active September 13, 2025 02:46
[bookmarklet] Sort recent youtube videos by popularity
javascript:(function(){if(window.__ytOBV){window.__ytOBV.tog();return}var s={d:true,c:null,mo:null,bmo:null,tm:0};function p(t){if(!t)return 0;t=t.replace(/\u00A0|\u202F/g,' ').toLowerCase();var m=1;if(/тыс|k\b/.test(t))m=1e3;else if(/млн|m\b/.test(t))m=1e6;else if(/млрд|b\b/.test(t))m=1e9;var n=(t.match(/[\d.,]+/)||['0'])[0];if(n.indexOf(',')>-1&&n.indexOf('.')>-1)n=n.replace(/,/g,'');else if(n.indexOf(',')>-1)n=n.replace(',','.');n=parseFloat(n)||0;return n*m}function find(){return document.querySelector('#contents.ytd-rich-grid-renderer,ytd-rich-grid-renderer #contents,#contents')}function Gtext(el){var spans=el.querySelectorAll('span.inline-metadata-item');for(var i=0;i<spans.length;i++){var tt=spans[i].innerText||'';if(/view|просм|тыс|млн|млрд|k|m|b/i.test(tt))return tt}return spans[0]&&spans[0].innerText||''}function app(){var c=s.c=find();if(!c)return;var items=Array.from(c.querySelectorAll('ytd-rich-item-renderer'));var arr=items.map(function(el){var node=el;while(node.parentElement&&node.parentElemen
@remixer-dec
remixer-dec / install.sh
Last active May 3, 2025 15:12
debian bullseye aarch64, install pip for python3.9
#!/bin/bash
[ "$EUID" -ne 0 ] && exec sudo "$0" "$@"
# switch to root
wget "ftp.cz.debian.org/debian/pool/main/p/python3-stdlib-extensions/python3-lib2to3_3.9.2-1_all.deb"
wget "ftp.dk.debian.org/debian/pool/main/p/python3-stdlib-extensions/python3-distutils_3.9.2-1_all.deb"
wget "http://security.debian.org/debian-security/pool/updates/main/s/setuptools/python3-setuptools_52.0.0-4+deb11u1_all.deb"
dpkg -i python3-lib2to3_3.9.2-1_all.deb
dpkg -i python3-distutils_3.9.2-1_all.deb
dpkg -i python3-setuptools_52.0.0-4+deb11u1_all.deb
apt-get update
@remixer-dec
remixer-dec / watch.go
Created April 8, 2025 16:01
transparent stopwatch (only minutes) for mac os
package main
import (
"fmt"
"time"
"github.com/progrium/darwinkit/dispatch"
"github.com/progrium/darwinkit/helper/action"
"github.com/progrium/darwinkit/helper/layout"
"github.com/progrium/darwinkit/macos"
@remixer-dec
remixer-dec / custom_lz77.py
Last active March 29, 2025 08:26
LZ7BHTS7
def decompress_lz_buffer(src_buffer: bytes) -> bytes:
"""
Decompress a byte array using custom LZ77 algorithm.
Args:
src_buffer: Compressed bytes
Returns:
Decompressed bytes
"""
@remixer-dec
remixer-dec / top_window_macos.py
Created September 14, 2024 00:19
gets information about window name and app name of top window
import os
def get_window_name_with_applescript():
window_name = os.popen("osascript -e 'tell application \"System Events\" to get the name of window 1 of (first application process whose frontmost is true)'").read().strip()
process_name = os.popen("osascript -e 'tell application \"System Events\" to get the name of (first application process whose frontmost is true)'").read().strip()
return window_name, process_name
@remixer-dec
remixer-dec / run_msi_on_windows_for_arm.txt
Last active February 8, 2022 10:06
Install x86 / x64 MSI on Windows for ARM
How to fix the error "This version of ... is designed to run on a 32-bit windows operating system" on ARM version of windows?
Run this command in the cmd with your msi file.
msiexec -i FILENAME.MSI /passive
Element.prototype.createEvent = function(name, ...params) {
return new CustomEvent(name, ...params)
}
console.info = function(...args) {
console.log(...args)
}
//this is just a placeholder
class SVGElement {
@remixer-dec
remixer-dec / color_utils.py
Created July 25, 2020 19:48
HSL to RGB, RGB to INT convertion for micropython
#input: [H (0 to 360), S (0 to 100), L (0 to 100)]
#output: [R (0 to 255), G (0 to 255), B (0 to 255)]
#reference: https://gist.github.com/PaulKinlan/d4053acfffd49abfa197a8d370a18337
def hsl_to_rgb(HSLlist):
H, S, L = HSLlist
S = S / 100
L = L / 100
C = (1 - abs(2 * L - 1)) * S
X = C * (1 - abs(((H / 60) % 2) - 1))
m = L - C / 2;
@remixer-dec
remixer-dec / FixedSizeArrayLiFo.js
Created May 8, 2020 13:32
Fixed size / length array (LiFo) for infinite pushing
//Warning: fixed size is only kept for .push() method
//Usage:
//let arr = new FixedSizeArrayLifo(2)
//arr.push(123); ...
class FixedSizeArrayLiFo extends Array {
constructor(size) {
super()
this.#size = size
}
@remixer-dec
remixer-dec / jarhasher.js
Last active August 26, 2022 12:35
Node script for hashing J2ME JAR files, excluding editable parts
// MULTI-CORE J2ME JAR HASHER | EXCLUDES EVERYTHING INSIDE MANIFEST FOLDER TO IGNORE MANIFEST-ONLY-CHANGES | (c) Remixer Dec 2019 | License: CC BY-NC 4.0
// usage: node jarhasher.js "C:/path/to/folder_with_jar_files_only_with_forward_slashes" CPU_LOGICAL_CORES HASHLIMIT
// output: 2 files hashed.json, corrupted.json
// output format: [["filename","md5","sha1"],...]
const os = require('os')
const JSZip = require("jszip");
const fs = require("fs")
const crypto = require('crypto')
const cluster = require('cluster');