Skip to content

Instantly share code, notes, and snippets.

@mikaello
mikaello / slack_workspace_view_tampermonkey.js
Last active September 21, 2023 07:33
Enable slick Slack Workspace view in browser, add script in Tampermonkey extension
// ==UserScript==
// @name Enable Slack Workspace Switcher on Desktop
// @namespace slack.com
// @version 1
// @author /u/Karasuni
// @description Enable the otherwise chromebook-only Slack workspace switcher
// @match https://app.slack.com/*
// @match https://app.slack.com/
// @grant none
// @run-at document-start
@mikaello
mikaello / group-objects-by-property.md
Last active December 9, 2023 11:15 — forked from JamieMason/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group array of JavaScript objects by keys

This fork of JamieMason's implementation changes the key parameter to be an array of keys instead of just a single key. This makes it possible to group by multiple properties instead of just one.

Implementation

const groupBy = keys => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = keys.map(key => obj[key]).join('-');
@mikaello
mikaello / install-npm-dependencies-globally.mjs
Last active February 28, 2024 14:07
Install NPM dependencies in package.json globally
/**
* It is not possible to install a package.json globally with NPM natively, so this script
* fascilitates such a workflow. This could be handy if you wan't e.g. Renovate to maintain the
* versions in the package.json.
*/
import { execSync } from "child_process";
import fs from "fs";
const packageJson = JSON.parse(fs.readFileSync("package.json"));
@mikaello
mikaello / Brunskrubber.md
Last active April 9, 2024 17:55
Skrubber og deres kjennetegn

Brunskrubber

Art Hattfarge Skrubbfarge Fargeendring Trær
Brunskrubb
Leccinum scabrum
Brun, lærbrun Gråsvarte, blir grovere nedover stilken Ingen, svakt rødnende Bjørk
Rødnende brunskrubb
Leccinum roseofractum
Brun Svart Rosa Bjørk
Svartskrubb
Leccinum variicolor
Mørk gråbrun/svart, spettet Grove gråbrune til gråsvarte Rosa øverst, blågrønn i basis Bjørk
Sotskrubb
Leccinum melaneum
Svart Mørk brun til svart Ingen, gråhvit, rosa, blå i basis Bjørk
Myrskrubb
Leccinum bolopus
Lys gråbrun Hvite til oker til grålig/svart Grønn, blågrønn mot basis Bjørk
Fjellskrubb Leccinum rotundifoliae Lys brun Hvite til brune Ingen Dvergbjørk
@mikaello
mikaello / outback-wheel-spec.md
Last active April 26, 2024 12:49
Hamax Outback wheel specification

Specification for the wheels on Hamax Outback.

Wheel: 16"

Spokes:

Type Spec
Length 164mm
Spoke type J-bend
@mikaello
mikaello / git-commit-change-author-email.md
Last active May 5, 2024 09:28
Change Git commit author / email in existing commits

Docs: https://github.com/newren/git-filter-repo/blob/main/Documentation/converting-from-filter-branch.md#changing-authorcommittertagger-information and https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html#_filtering_of_names_amp_emails_see_also_name_callback_and_email_callback

git filter-repo \
  --email-callback ' return email if email != b"OLD_EMAIL" else b"NEW_EMAIL" ' \
  --name-callback 'return name.replace(b"OLD_AUTHOR", b"NEW_AUTHOR")' \
  --force \
  --refs HEAD~<NUMBER_OF_COMMITS>..<BRANCH_NAME> # This line is optional, remove to do the change in all commits (will rewrite complete history)