Skip to content

Instantly share code, notes, and snippets.

@niamu
niamu / dribbble-fix.js
Last active Jun 8, 2022
A Dribbble bookmarklet to replace signup links to actual shot links
View dribbble-fix.js
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 Mar 12, 2022
A Wordle Bookmarklet Cheat to show the answer in an in-game notification
View wordle-cheat.js
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 Mar 13, 2022
Plex Bookmarklet for scaling videos (when video content has black bars on top/bottom)
View plex-scale.js
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 Aug 4, 2021
Miniflux Custom CSS (layer on top of "Dark - Sans Serif" theme)
View custom-miniflux.css
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 Mar 24, 2017
Swatch Internet Time (Beats Time)
View beats.cljs
;; 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))))
View keybase.md

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: