Skip to content

Instantly share code, notes, and snippets.

View erhaem's full-sized avatar
💀

erhaem

💀
View GitHub Profile
@erhaem
erhaem / expand-row-notion.js
Created October 28, 2026 01:35
expand row notion
javascript:void(function(){
const b = document.querySelectorAll('div[role="button"][aria-label="Open"]');
if(b) { b.forEach(e => e.click()) }
})()
@erhaem
erhaem / kompas-copy.js
Created October 26, 2026 01:32
kompas.com open copy page
javascript:void(function() {
const l = window.location.href;
if (l.indexOf("kompas.com/read/") > -1) {
window.location.href = l.replace("/read/", "/copy/");
} else console.log("not kompas, skip");
})()
@erhaem
erhaem / user.js
Created October 24, 2026 03:26
my personal firefox user.js, sourced from https://github.com/yokoffing/Betterfox (modified)
//
/* You may copy+paste this file and use it as it is.
*
* If you make changes to your about:config while the program is running, the
* changes will be overwritten by the user.js when the application restarts.
*
* To make lasting changes to preferences, you will have to edit the user.js.
*/
/****************************************************************************
@erhaem
erhaem / migrate-firefox-profile.sh
Created October 23, 2026 14:25
firefox profile: import history, session, containers to another profile
#!/usr/bin/env bash
set -euo pipefail
# profile path
FROM="xxx.default-release"
TO="xxx.default-esr"
PROFILE_DIR="$HOME/.mozilla/firefox"
SOURCE="$PROFILE_DIR/$FROM"
DEST="$PROFILE_DIR/$TO"
@erhaem
erhaem / allow-cloudflare-ufw.sh
Created July 19, 2026 08:07
allow cloudflare ips in ufw
curl https://www.cloudflare.com/ips-v4 -o /tmp/cf-ips.txt
for ip in $(cat /tmp/cf-ips.txt); do sudo ufw allow from $ip to any port 443; done
for ip in $(cat /tmp/cf-ips.txt); do sudo ufw allow from $ip to any port 80; done
@erhaem
erhaem / downgrade.sh
Last active February 27, 2026 15:27
gnome dash to dock v103 sucks, auto-hide not working. downgrade to 102
#!/bin/sh
#---------------------------------------
# To downgrade Dash to Dock version 102
# thanks to @Smyrcu for the idea
#
# Usage:
# chmod +x downgrade.sh
# ./downgrade.sh
# --------------------------------------
@erhaem
erhaem / firefox-wayland-dropped-video-frames.md
Created November 26, 2025 08:26 — forked from defron/firefox-wayland-dropped-video-frames.md
Fix issue with Firefox Wayland Dropped Frames on Youtube Videos

I was experiencing a significant amount of dropped frames during video playback after switching to Wayland and finally was able to find a fix that worked for me

During youtube playback I would experience 10+ frames dropped all at once, causing a noticable skip.

Saw a few people having similar issues:

https://askubuntu.com/questions/1520102/why-do-i-get-so-many-frame-drops-on-wayland-with-youtube-playback

https://forum.manjaro.org/t/my-browser-drops-a-bunch-of-frames-while-playing-youtube-videos/168839

@erhaem
erhaem / user.js
Last active December 31, 2025 03:08
disable AI features on Firefox | tutorial: https://youtu.be/Re7RCBLw8-k?si=2BsiIfno4oT5k94H
// disable AI features on Firefox
user_pref("browser.ml.enable", false);
user_pref("browser.ml.chat.enabled", false);
user_pref("browser.ml.chat.sidebar", false);
user_pref("browser.ml.chat.shortcuts", false);
user_pref("browser.ml.chat.page", false);
user_pref("browser.ml.chat.page.footerBadge", false);
user_pref("browser.ml.chat.page.menuBadge", false);
user_pref("browser.ml.chat.menu", false);
user_pref("browser.ml.linkPreview.enabled", false);
@erhaem
erhaem / part11.sql
Last active October 13, 2025 15:22
Weather Observation Station hackerrank
SELECT DISTINCT city
FROM station
WHERE city REGEXP '^[^aeiouAEIOU]'
or city REGEXP '[^aeiouAEIOU]$';
@erhaem
erhaem / grades.go
Created October 6, 2025 14:25
rounding students grades hackerrank
package main
import (
"fmt"
)
func main() {
grades := []int32{73, 67, 38, 33}
fmt.Println(grades)