Skip to content

Instantly share code, notes, and snippets.

@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)
@erhaem
erhaem / settings.json
Last active January 26, 2025 15:16
My VSCode settings with decluttered unnecessaries/disctractions!
{
"breadcrumbs.enabled": false,
// Window and Title Settings
"window.title": " ", // Set window title to a blank space
"window.menuBarVisibility": "compact", // Compact menu bar visibility
"window.commandCenter": false, // Disable command center
"workbench.editor.showTabs": "single", // Show only a single editor tab
"workbench.editor.tabSizing": "shrink", // Shrink tab sizes to fit
"workbench.editor.labelFormat": "short",
// Update and Telemetry Settings
@erhaem
erhaem / aingcreations-encoding.md
Created October 25, 2024 03:24
AingCreations Encoding. I miss AingCreations :'(

Encode/decode strings the AingCreations way. That is to map characters in a string to their respective indices and reconstructing the original string from that mapping

/**
 * @param {string} str - The string to encode.
 * @returns {object} - The object mapping each character to an array of its indices
 */
var encode = function(str) {
  var mapping = {};

  for (var i = 0; i < str.length; i++) {
@erhaem
erhaem / GitCommitBestPractices.md
Created October 16, 2024 07:51 — forked from luismts/GitCommitBestPractices.md
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@erhaem
erhaem / copy-text2clipboard.md
Created August 28, 2024 02:50
Copy text to clipboard using Bookmarklet
javascript:void(function(){
  const copyListener = event => {
    document.removeEventListener("copy", copyListener, true);
    event.preventDefault();
    let clipboardData = event.clipboardData;
    clipboardData.clearData();
    clipboardData.setData("text/plain", "<<TEXT TO COPY>>");
  };
document.addEventListener("copy", copyListener, true);
@erhaem
erhaem / google-doodle-paris-2024.md
Last active July 31, 2024 04:49
Google Doodle: Paris 2024 cheat

Google Doodle: Paris 2024 cheat

Sorry for messing up the fun. This script helps you spot the clickable object on Google Doodle Paris 2024 https://searchplayground.google/paris-2024.

javascript:void(function(){
const buttons = document.querySelector('spg-root')
  .shadowRoot.querySelector('bsx-gtm-tracking spg-interactive-map')
  .shadowRoot.querySelector('spg-interactive-layer')
  .shadowRoot.querySelectorAll('button[class="  "]:not([aria-pressed])');

buttons.forEach((btn) =&gt; {
@erhaem
erhaem / discord_token.md
Last active July 19, 2024 03:32
Get Discord Token (Bookmarklet/Js Inject)

Get Discord Token (Bookmarklet)

Usage

Copy and paste this following code onto your browser bookmark bar, then click the bookmark after.

javascript:void(function(){prompt('Here is your Discord token',(webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken())})()

Credits

Props to Gilgameš for sharing the code