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
@prescience-data
prescience-data / filesystem.ts
Last active May 26, 2025 13:37
Save and restore session data using Playwright
import { exec } from "node:child_process"
import { createReadStream, createWriteStream, existsSync, readFileSync } from "node:fs"
import { mkdir } from "node:fs/promises"
import { basename, dirname, join } from "node:path"
import { pipeline } from "node:stream/promises"
import { promisify } from "node:util"
import { createGzip } from "node:zlib"
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3"
@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
@tomnomnom
tomnomnom / bash-timestamp.sh
Created December 18, 2024 11:22
Print a grey timestamp before running bash commands
PROMPT_COMMAND='PS1_RUN_PREEXEC=1'
preexec() {
if [ -z "$PS1_RUN_PREEXEC" ]; then
return
fi
unset PS1_RUN_PREEXEC
echo $'\e[38;5;241m'"[$(date +'%Y-%m-%dT%H:%M:%S%z')]"$'\e[0m'
}
trap 'preexec' DEBUG
@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 April 24, 2025 10:07
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
@mukesh-610
mukesh-610 / favicon_mapper.py
Created September 9, 2024 09:01
Grabs the favicon of a target site and searches it against a database of known favicons to fingerprint your target web application.
import hashlib
import requests
import yaml
import argparse
YAML_FILE = 'favicons-database.yml'
def fetch_favicon(url):
try:
response = requests.get(f'{url}/favicon.ico', timeout=10, verify=False)
@armenr
armenr / clipsync.sh
Last active June 3, 2025 16:30
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 May 29, 2025 12:51
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)