Skip to content

Instantly share code, notes, and snippets.

@VKen
VKen / README.md
Last active March 19, 2025 00:38
Re-enable disabled firefox extensions addons 2025-03-15

Re-enable all firefox's disabled extensions addons 2025-03-15

RUN THIS SCRIPT AT YOUR OWN RISK

This is for addons signature expiry of firefox in 2025-03-15. Not recommended unless you understand the security risks.

If you are not running Firefox ESR with xpinstall.signatures.required set to false i.e. normal firefox, then you have some steps to follow first to tweak your firefox, your OS's methods may vary:

This script is to be run in firefox developer console.

@VKen
VKen / lcm.js
Created November 25, 2019 17:02
Get Lowest/Smallest Common Multiple From a Sequential Range of Numbers
/* get the lowest common multiple from a sequential range of numbers
expect arr = [a, b], where `a` and `b` are the (inclusive) edge range of natural numbers
*/
function smallestCommons(arr) {
let min = Math.min(...arr), max = Math.max(...arr),
numList = Array.from(Array(max - min +1).keys(), (val) => val + min),
factorMap = {};
numList.forEach((val) => { // generate the prime factors count mapping
for (let [key, value] of Object.entries(primeFactor(val))) {
@VKen
VKen / docker-start-celery-multi-worker-entrypoint
Created September 19, 2019 03:57
Running celery multi in docker container with running logs, signal trap, and graceful shutdown & restart
#!/bin/sh
# safety switch, exit script if there's error. Full command of shortcut `set -e`
set -o errexit
# safety switch, uninitialized variables will stop script. Full command of shortcut `set -u`
set -o nounset
# tear down function
teardown()
{
@VKen
VKen / .gitconfig
Created December 21, 2018 07:33
Fix for vimdiff vim-plugins clashes between minibufexpl.vim and splice.vim when using as git mergetool in git config
[diff]
tool = gvimdiff
[merge]
# Note: `sjl/splice.vim` is unmaintained and has a bug with one
# of the views. Use fork from `albfan/splice.vim` instead
tool = splice
[mergetool "splice"]
# minibufexpl.vim uses some window space, splice's default calculation
# and resizing did not take that into account therefore, switch off
# minibufexpl.vim's window auto start, so splice can control window space fully