Skip to content

Instantly share code, notes, and snippets.

@niamu
niamu / thechoiceisyours.whatisthematrix.com
Last active July 13, 2023 02:24
Archive tool for The Matrix Resurrections teasers
#!/usr/bin/env bash
make_trailer() {
echo 'Generating 17'$1'-a-b'$3'-c'$2'-d-e'$4'-f-g'$5'-h'$6'-i.mp4...'
mkdir -p ./tmp/
choice=$1
time=$2
b=$3
e=$4
g=$5
@niamu
niamu / dribbble-fix.js
Last active June 8, 2022 03:27
A Dribbble bookmarklet to replace signup links to actual shot links
javascript:(function(){
function replace() {
document.querySelectorAll("a[data-subject-id]").forEach(
function(e) {
e.href = "/shots/" + e.dataset.subjectId;
e.removeAttribute("data-signup-trigger");
var old_element = e;
var new_element = old_element.cloneNode(true);
old_element.parentNode.replaceChild(new_element, old_element);
}
@niamu
niamu / wordle-cheat.js
Created March 12, 2022 22:12
A Wordle Bookmarklet Cheat to show the answer in an in-game notification
javascript:(function(){
toaster=document.querySelector("game-app").shadowRoot.querySelector("#game-toaster");
app=new wordle.bundle.GameApp();
t = document.createElement("game-toast");
t.setAttribute("text", app.solution.toUpperCase());
t.setAttribute("duration", 2e3);
toaster.prepend(t);
})();
@niamu
niamu / plex-scale.js
Last active February 12, 2023 18:30
Plex Bookmarklet for scaling videos (when video content has black bars on top/bottom)
javascript:(function(){
video = document.querySelector("video");
currentScale = video ? video.style.transform : "";
console.log(currentScale);
document.addEventListener("fullscreenchange", function() {
video.style.transform = "";
});
function ce(t) { return document.createElement(t) };
lookup = {
"1:1": 1,
@niamu
niamu / custom-miniflux.css
Created August 4, 2021 16:21
Miniflux Custom CSS (layer on top of "Dark - Sans Serif" theme)
body {
margin: 2em;
max-width: none;
--body-background: #333;
--link-color: #CCC;
--link-hover-color: #FFF;
--item-meta-li-color: #666;
--item-border-color: #444;
}
@niamu
niamu / beats.cljs
Last active March 24, 2017 18:16
Swatch Internet Time (Beats Time)
;; https://en.wikipedia.org/wiki/Swatch_Internet_Time
(defn beats
[]
(let [d (js/Date.)]
(->> (/ (+ (.getUTCSeconds d)
(* (.getUTCMinutes d) 60)
(* (inc (.getUTCHours d)) 3600))
86.4)
(.floor js/Math))))

Keybase proof

I hereby claim:

  • I am niamu on github.
  • I am niamu (https://keybase.io/niamu) on keybase.
  • I have a public key whose fingerprint is E115 849B 95B4 52AF 1C9F 3C4E BA93 F75E ED4D 48FE

To claim this, I am signing this object: