Skip to content

Instantly share code, notes, and snippets.

View nicoandmee's full-sized avatar
🏠
Working from home

Nico Kokonas nicoandmee

🏠
Working from home
View GitHub Profile
@AzureFlow
AzureFlow / rotateString.js
Created March 24, 2025 03:58
Akamai BMP native (`libakamaibmp.so`) string concealment
const RotateDirection = Object.freeze({
Left: -1,
Right: 1,
});
// Init the ASCII character mapping table (equivalent to the large local_* arrays)
// /** @type {string[]} */
// const charMap = [];
// for(let i = 32; i < 127; i++) {
// // Skip " ' \ \x7F
@transitive-bullshit
transitive-bullshit / hash-object.ts
Created November 7, 2024 19:14
Get the hash of an object
import decircular from 'decircular'
import isObject from 'is-obj'
import sortKeys from 'sort-keys'
import { type LiteralUnion } from 'type-fest'
export type Encoding = 'hex' | 'base64' | 'buffer'
export type Algorithm = LiteralUnion<'sha1' | 'sha256' | 'sha512', string>
export type Options = {
/**
@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active January 23, 2025 22:45
Bookmarklet that lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(t){if(t){var e=window.open("","_blank","width=800,height=600");e.document.open(),e.document.write(t),e.document.close()}else alert("Clipboard is empty. Please copy some text to the clipboard first.")}).catch(function(t){console.error("Failed to read clipboard contents: ",t),alert("An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.")})}catch(t){console.error("An error occurred:",t),alert("An error occurred while trying to open the new window with the clipboard content.")}})();//bookmarklet_title: HTML Preview from Clipboard
@armenr
armenr / clipsync.sh
Last active April 1, 2025 21:25
ClipSync (2-way clipboard sync between Wayland and X11 + cliphy support)
#!/usr/bin/env sh
#
# Two-way clipboard syncronization between Wayland and X11, with cliphy support!
# !! Recommended use: Drop this file off @ /usr/local/bin/clipsync && make it executable
# Requires: wl-clipboard, xclip, clipnotify.
# Modified from: https://github.com/hyprwm/Hyprland/issues/6132#issuecomment-2127153823
#
# Usage:
# clipsync watch [with-notifications|without-notifications] - run in background.
# clipsync stop - kill all background processes.
@kverb
kverb / wsj_ladder.js
Created August 30, 2024 16:56
WSJ Ladder on cloudflare workers
// JS Snippet for a cloudflare worker to get the "Shareable" URL for a wsj.com article by URL.
// Requires a valid, authenticated wsj.com cookie jar.
// Uses a cloudflare workers KV namespace bound to `TestKV` to store/fetch the cookies.
// getting these cookies is a pain. This was extracted using the chrome dev tools > copy request as Fetch and manually filtering out just the cookie header
const default_cookies = 'datadome=7S65yfEc866mp9GpkZUQXtvYKJHblCG5VlkmmCEzHErmZn4Cxj1DizrKaq6u_WW~SL3xkFUyv2sas2PJxIMAdJxPJ3skZr009v4kbL4sHsdYAnJHZhN0wtr8F8WRDz1l; djcs_route=7055a21f-09ec-48b1-b187-06518dfd9f6f; ca_rt=3IX-ARt2INJ47c8pbe87kw.SvzY1D2JoWw2n_c_Y3_wN78ns1LcSsITZEjFkMVz9K-dt9Nv7zaM-KWrg7GZRSWwHURy6sMrpRN6x68I6P9mtncYsvXMhVCnFdZnEnVxlj8; _pcid=%7B%22browserId%22%3A%22ltofwg00gm2jgtk9%22%7D; cX_P=ltofwg00gm2jgtk9; _pubcid=ddebe880-2003-4d12-8da8-2511b02cc014; _sp_su=false; TR=V2-a80a4882c66bd273e8409f9b32bf2dc04f6968616ebc9adf8c862073eeb1efea; ab_uuid=2eaa406a-31e0-49a8-bad2-bb149907d4d2; _ncg_domain_id_=00f9e1d
@adtac
adtac / README.md
Last active April 7, 2025 12:59
Using your Kindle as an e-ink monitor

3.5 fps, Paperwhite 3
@adtac_

step 1: jailbreak your Kindle

mobileread.com is your best resource here, follow the instructions from the LanguageBreak thread

I didn't really follow the LanguageBreak instructions because I didn't care about most of the features + I was curious to do it myself, but the LanguageBreak github repo was invaluable for debugging

@wenjie1991
wenjie1991 / group_all_windows.sh
Created August 2, 2024 20:50
Hyprland Group all windows in a workspace
#!/bin/bash
# Get the active workspace ID
active_workspace=$(hyprctl activeworkspace -j | jq '.id')
# Get addresses of all windows in the active workspace
windows=$(hyprctl clients -j | jq -r ".[] | select(.workspace.id == $active_workspace) | .address")
# Focus the first window
hyprctl dispatch focuswindow address:$(echo "$windows" | head -n 1)
@velzie
velzie / manifest-v2-chrome.md
Last active April 20, 2025 14:00
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

#!/usr/bin/env bash
ws_state=$(hyprctl workspaces -j)
cli_state=$(hyprctl clients -j | jq -r 'map(select(.workspace.id > 0))')
curr_ws_id=$(hyprctl activeworkspace -j | jq -r .id)
new_ws_id=0
hypr_cmds=""
i=0
while read -r v; do
@Pymmdrza
Pymmdrza / R2cloudflare_V1_6.py
Last active December 31, 2024 23:20
R2 Cloudflare Upload file with boto in python
# https://gist.github.com/Pymmdrza/3e3f30b16f4009503e7572b914fd200d
# install package's from requirements.txt
# Windows : pip install -r requirements.txt
# Linux : pip3 install -r requirements.txt
import os
import boto3
from tqdm import tqdm
from colorthon import Colors as Fore
def get_user_input(prompt, example=''):