Skip to content

Instantly share code, notes, and snippets.

// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@koveseb
koveseb / generate-ssh-key.sh
Created December 13, 2020 16:39 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@koveseb
koveseb / git-commit-template.txt
Last active January 8, 2021 01:34
Git Commit Template
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
@koveseb
koveseb / eternal-bash-history.txt
Last active August 31, 2024 09:07
Eternal bash history
# Eternal bash history.
# ---------------------
# Undocumented feature which sets the size to "unlimited".
# http://stackoverflow.com/questions/9457233/unlimited-bash-history
export HISTFILESIZE=
export HISTSIZE=
export HISTTIMEFORMAT="[%F %T] "
# Change the file location because certain bash sessions truncate .bash_history file upon close.
# http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login
Basic usage
- h, j, k, l: scroll left, down, right, up, and right
- j, k: scroll vertically
- h, l: scroll horizontally
- Ctrl+U, Ctrl+D: scroll pages by half of screen
- Ctrl+B, Ctrl+F: scroll pages by a screen
- 0, $: scroll a page to leftmost/rightmost
- gg, G: scroll to top/bottom
Shortcut for Clear Cache | Ctrl+Shift+9
Toggle Dark Reader | Shift+Alt+D
Toggle Dark on current site | Shift+Alt+A
Firefox Screenshot | Ctrl+Shift+S
Flagfox Geotool | Shift+Alt+G
Opens the popdown FHC dialog | Shift+Alt+P
Open the main FHC dialog | Shift+Alt+F
Show/hide formfields | Ctrl+Shift+F
Fill fields with recent entries | Shift+Alt+R
Fill with often used entries | Shift+Alt+O
Expected Behavior
Current Behavior
Possible Solution
Steps to Reproduce
"If applied, this commit will …."
[Reference](https://www.theserverside.com/video/Follow-these-git-commit-message-guidelines)
@koveseb
koveseb / firefox-developer-edition-installation.md
Last active January 11, 2021 18:22
How to install Firefox Developer Edition on Linux

Download from Mozilla Firefox Developer Edition webpage. Extract it with file-roller and move the folder to its final location. A good practice is to install it in /opt/ or /usr/local/.

Once you moved the files to their final location (say /opt/firefox-dev/), you can create the following file ~/.local/share/applications/firefox-dev.desktop to get a launcher with an icon distinct from normal Firefox.

[Desktop Entry]
Name=Firefox Developer
GenericName=Firefox Developer Edition
Exec=/opt/firefox-dev/firefox %u
Terminal=false
Icon=/opt/firefox-dev/browser/chrome/icons/default/default128.png

@koveseb
koveseb / compress-video.sh
Last active December 31, 2021 11:41
Compress mp4 video for web
# Output as muted mp4
ffmpeg -i source.mp4 -an -vcodec copy output-min.mp4
# Very slow compress
ffmpeg -i input.avi -c:v libx264 -crf 18 -preset veryslow -c:a copy out.mp4
# Output as webm
ffmpeg -i source.mp4 -c:v libvpx-vp9 -b:v 1M -pass 1 -f webm /dev/null && ffmpeg -i source.mp4 -c:v libvpx-vp9 -b:v 1M -pass 2 output.webm
# Mute video