Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / readStdin.kt
Last active September 30, 2022 07:25
Read stdin with Kotlin, util for Kattis input parsing
fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readInts() = readStrings().map { it.toInt() }
fun readLong() = readString().toLong()
fun readLongs() = readStrings().map { it.toLong() }
fun readDouble() = readString().toDouble()
fun readDoubles() = readStrings().map { it.toDouble() }
fun main(){
@mikaello
mikaello / un-urn-json.kt
Created September 18, 2021 14:23
Un URN JSON
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.ObjectNode
import com.fasterxml.jackson.databind.node.TextNode
private val typeMap = mutableMapOf<String, String>()
private fun parseReferences(jsonNode: JsonNode, path: String) {
val ITEMS = "items"
val ID = "id"
@mikaello
mikaello / git-commit-change-author-email.md
Last active April 19, 2021 07:36
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)
@mikaello
mikaello / IOF_v2.xsd
Last active April 5, 2021 06:26
IOF v2 DTD converted to XSD with W3 tool dtd2xsd.pl
<schema
xmlns='http://www.w3.org/2000/10/XMLSchema'
targetNamespace='http://www.w3.org/namespace/'
xmlns:t='http://www.w3.org/namespace/'>
<element name='IOFVersion'>
<complexType>
<attribute name='version' type='string' use='fixed' value='2.0.3'/>
</complexType>
</element>
@mikaello
mikaello / wsl2-troubleshooting.md
Last active March 4, 2021 07:32
Install WSL2 troubleshooting

Getting started with WSL2

Start by following this guide: https://docs.microsoft.com/en-us/windows/wsl/install-win10. Another nice resource is the blog post Setting up WSL2 and Oh My Zsh.

When running the dism.exe commands during setup you may get an error saying that you need elevated permissions, even if you run PowerShell as admin, you then need to run this command first to get elevated permissions:

Start-Process powershell -Verb runAs
@mikaello
mikaello / emit-devices-info.md
Last active August 1, 2020 11:39
Information about EMIT devices

Device info for EMIT devices

Commands are executed on a Macbook Pro, OSX 10.14.6

250 and MTR4 are recognized as serial devices on OSX, while eScan is recognized as a USB only (while behaviour seems to be serial like).

https://i.ibb.co/X4mhJ63/20200801-133326.jpg

ioreg