Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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