Skip to content

Instantly share code, notes, and snippets.

View sverrejoh's full-sized avatar

Sverre Johansen sverrejoh

View GitHub Profile
@sverrejoh
sverrejoh / README.md
Last active February 6, 2026 20:28
tmux.conf — Tokyo Night theme, top status bar, Emacs copy mode, fzf session switcher

tmux.conf

My tmux config. Tokyo Night color scheme, top status bar with system stats, Emacs-style copy mode, and fzf session switching.

Prerequisites

  • tmux 3.3+
  • TPM (Tmux Plugin Manager)
  • fzf (for session switcher popup)
  • A Nerd Font (for status bar icons)
(defun svj-npm-get-latest-version (dependency-name)
(let* ((url (format "https://registry.npmjs.org/%s" dependency-name))
(buffer (url-retrieve-synchronously url t)))
(with-current-buffer buffer
(goto-char url-http-end-of-headers)
(unwind-protect
(cdr (assq 'latest (assq 'dist-tags (json-read))))
(kill-buffer buffer)))))
(defun svj-npm-query-replace-dependency ()
const delayRenderMs = 1000;
const loadBeforeAnimateMs = 2000;
const timeoutMs = 15 * 1000;
const minLoadMs = 250;
const machine = Machine(
{
id: "load",
initial: "delay",
@sverrejoh
sverrejoh / README.md
Created May 25, 2020 19:36
US Layout with Caps Lock as Ctrl and Norwegian letters æøå similar to the Mac

Keyboard Layout Creator Source File

This is a US Layout for Windows, with Caps Lock as Ctrl and æøå on alt-; alt-o and alt-a, Like the Mac US Layout

@sverrejoh
sverrejoh / .zshrc
Created May 6, 2020 15:34
Function for sending a notification from shell
function tellme() {
# The success value from the previous command (have to keep it or
# it'll be overwritten by the equation below)
local previous=$?
local statusMessage
[[ $previous -eq 0 ]] \
&& statusMessage="Success" \
|| statusMessage="Failure"
<html lang="nb"><head><base href="http://device.e-pages.dk/template/packages2/default/2/7/default/1_desktop/">
<!-- Template version: 1 -->
<!-- Template date: 2016-09-01 11:24:59 -->
<!-- Template base version: 7 -->
<!-- Template base date: 2016-09-01 11:24:58 -->
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta id="viewport" name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link href="singlearticlepage_type_article_style_articleview/singlearticlepage_type_article_style_articleview.css?[NO_CACHE]" type="text/css" rel="stylesheet">
@sverrejoh
sverrejoh / index.flow.jsx
Last active July 18, 2016 21:13
React component with typed Refs
// @flow
import React from "react";
type Refs = {
// the ref `foo` is a button (or null, because it might not be mounted).
foo: HTMLButtonElement | null
};
class Foo extends React.Component {

Keybase proof

I hereby claim:

  • I am sverrejoh on github.
  • I am sverrejoh (https://keybase.io/sverrejoh) on keybase.
  • I have a public key whose fingerprint is 7203 A99C 1EBD 3131 C287 EBC6 CB5C 1539 6D30 593B

To claim this, I am signing this object:

/* @flow */
type FooStyle = {
style: {
width: number,
},
data: {
type: "foo"
}
}
@sverrejoh
sverrejoh / addToMap.js
Created November 4, 2015 14:09
Add to a List in a Map
state.set(action.tickedId, (state.get(action.ticketId) || Immutable.List()).push(action.file));