Skip to content

Instantly share code, notes, and snippets.

mikaello / jsx-in-html.html
Last active May 22, 2019
Write JSX in HTML file
View jsx-in-html.html
<!DOCTYPE html>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
Also worth checking out:
View Trenger orienteringsløpere flottvaksine?.md

Trenger orienteringsløpere flåttvaksine?

Flått som kryper på arm

Bilde: John Tann

For alle som er mye i skogen er skogflåtten (skaumannen) noe man bør være obs på. Flåtten er en kjip skapning av typen edderkoppdyr, som kan være reservoar for viruset skogflåttencefalitt (tick borne encephalitis, TBE) og smittebærer av bakterien borrelia burgdorferi som kan gi sykdommen lyme borreliose (også kalt lyme eller borrelia) ved infeksjon.

Borreliainfeksjon kan man ikke vaksinere seg mot, men som en tommelfingerregel må en bakteriesmittet flått sitte fast på kroppen i 24 timer før man blir infisert. Så om du sjekker deg på kvelden etter endt o-løp og fjerner eventuelle flått er du mest sannsynlig try

mikaello /
Last active Aug 1, 2019
Bucklescript: get week number of year
/* For a given date, get the ISO week number
* This is copied from
* ... which is based on information at:
* Algorithm is to find nearest Thursday, it's year
mikaello / jsChrome.scpt
Last active Oct 14, 2019
Pipe JS from a file in terminal to be executed in Chrome via AppleScript
View jsChrome.scpt
(* Save this script as (e.g.) jsChrome.scpt and run it as follows
in a terminal:
osascript jsChrome.scpt someJSFile.js
The content of someJSFile.js will now be run in the active tab of
what is considered your "window 1" of a running Chrome instance.
If this is your first time running JavaScript in Google Chrome from
AppleScript, you will need to enable this in
mikaello /
Last active Apr 18, 2020
How to get started with CouchDB through Docker on OpenStack

Setting up a CouchDB with Docker on OpenStack

I will be using the OpenStack provider NREC, which is available for free for all students at the University of Oslo and University of Bergen (among others).

Setting up an instance in OpenStack

Create a Linux Virtual machine with SSH access (see NREC-tutorial), and test that you can log in:

$ ssh centos@<your instance public ip>
Last login: Tue Mar 24 06:33:00 2020 from <your machine>
mikaello /
Last active Aug 1, 2020
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).


mikaello /
Last active Mar 4, 2021
Install WSL2 troubleshooting

Getting started with WSL2

Start by following this guide: 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 / IOF_v2.xsd
Last active Apr 5, 2021
IOF v2 DTD converted to XSD with W3 tool
View IOF_v2.xsd
<element name='IOFVersion'>
<attribute name='version' type='string' use='fixed' value='2.0.3'/>
mikaello /
Last active Apr 19, 2021
Change Git commit author / email in existing commits

Docs: and

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)
View un-urn-json.kt
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"