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
@rmtbb
rmtbb / ChatGPT Canvas HTML Renderer from Clipboard.url
Last active November 10, 2024 20:51
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
@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 October 27, 2024 08:53
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 November 11, 2024 17:49
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
@mnoumanshahzad
mnoumanshahzad / make-to-just.sh
Created January 11, 2024 12:21
Port Makefile targets to Justfile recipes to enable incremental deprecation of Makefile usage
#!/bin/bash
# Name of the Makefile to be converted
MAKEFILE="Makefile"
# Name of the output Justfile
JUSTFILE="Justfile"
# Check if the Makefile exists
if [ ! -f "$MAKEFILE" ]; then
@sefidel
sefidel / kagi-oranginum.md
Last active November 9, 2024 23:27
Modern Kagi theme with an orange accent. Provides both light/dark variant.

Kagi Oranginum Theme

This is a new theme that provides support for Apr10 UI update.

Old version available here

Showcase

Dark Light
kagi-oranginum-dark kagi-oranginum-light
sanitise tridactyllocal
set escapehatchsidebarhack false
set smoothscroll true
set searchengine b
unbind <F1>
unbind <SA-ArrowUp><SA-ArrowUp><SA-ArrowDown><SA-ArrowDown><SA-ArrowLeft><SA-ArrowRight><SA-ArrowLeft><SA-ArrowRight>ba
unbind --mode=browser <A-6>
@pazimzadeh
pazimzadeh / init.lua
Created November 30, 2023 17:16
My Hammerspoon config file
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", function()
hs.reload()
end)
hs.alert.show("Config loaded")
hs.loadSpoon("ShiftIt")
spoon.ShiftIt:bindHotkeys({})
spoon.ShiftIt:bindHotkeys({
left = {{ 'alt', 'cmd' }, 'z' },