Skip to content

Instantly share code, notes, and snippets.

View rosvik's full-sized avatar
👋

Johannes Røsvik rosvik

👋
View GitHub Profile
@rosvik
rosvik / gist:4078ece89f7a208f55b5cd9d0fd5eb47
Last active November 27, 2025 21:28
WIP: Handleliste hyttetur
- [ ] Smågodt
- [ ] Kanskje noe annet?
@rosvik
rosvik / readme.md
Last active December 22, 2022 22:38
JourneyPlanner v2 vs v3

GraphQL query

query MyQuery {
  stopPlace(id: "NSR:StopPlace:42282") {
    id
    name
    quays {
@rosvik
rosvik / infinote.sh
Last active September 3, 2021 22:35
infinote v0.1
#!/usr/bin/env bash
# Path to infinote git repo
INFIPATH="$HOME/Git/infinote/"
# Path to the note file
INFIFILE="$HOME/Git/infinote/infinote.md"
# Author of automatic git commits
AUTHOR="infinote <[email protected]>"
@rosvik
rosvik / latex-build-and-release.yml
Created October 26, 2020 13:41
Latex build and release github action
name: Build LaTeX document
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
@rosvik
rosvik / .prettierrc
Last active July 15, 2019 12:20
Prettier configuration boilerplate
# Documentation: https://prettier.io/docs/en/configuration.html
# Configuration schema: http://json.schemastore.org/prettierrc
# Include parentheses around a sole arrow function parameter. Default: "avoid"
#arrowParens: "avoid"
# Print spaces between brackets. Default: true
#bracketSpacing: true
# Print (to stderr) where a cursor at the given position would move to after formatting.
@rosvik
rosvik / Hashtags.md
Last active May 19, 2019 11:04
Regex snippets

https://regex101.com/r/nZEH9j/2

Regex:

(?:\n[\h]*@|^[\h]*@)\K([0-9]+)(?=[\s]*\n|[\s]*$)|(?<=[\h\n,]@)([0-9]+)(?=[\h\n,.-]|$)|(?<=[\s,]@|^@)\K([a-zA-ZæøåÆØÅ_0-9]*[a-zA-ZæøåÆØÅ_]+[a-zA-ZæøåÆØÅ_0-9]*+)(?=[\s,]|[-.,:]*[\s]|[-.,:]*$)

Test string:

  @ab.
@rosvik
rosvik / wikipedia.css
Created May 3, 2019 15:41
Custom Wikipedia style sheet
body {
color: #ddd;
background-color: #222 !important;
}
span {
color: #ddd;
}
a, .tocnumber {
@rosvik
rosvik / rmd
Last active September 24, 2020 15:36
R markdown render file bash command
#!/bin/bash
#
# R markdown export bash command
# Author: Johannes T. Røsvik
# http://github.com/rosvik
#
# Usage:
# > rmd /path/to/file.rmd
#
@rosvik
rosvik / keybase.md
Created November 5, 2017 12:15
Keybase confirmation

Keybase proof

I hereby claim:

  • I am rosvik on github.
  • I am rosvik (https://keybase.io/rosvik) on keybase.
  • I have a public key ASDRi-_xvkMSaTRmflc9GIcsOKgqMF4gojucRGWqqr2qHQo

To claim this, I am signing this object:

@rosvik
rosvik / load.js
Last active February 10, 2019 22:05
JS/AJAX load file to HTML element
var params = {
htmlid: 'content',
path: 'pages/en/',
extention: '.html'
}
// Check for parameters at page load
getParam();
function getParam() {
var url_string = document.location.href;