Skip to content

Instantly share code, notes, and snippets.

@mtib
mtib / main.c
Created February 21, 2025 16:57
Maria's wiggly mouse
#include <Arduino.h>
#include <BleMouse.h>
#define SECOND 1000
BleMouse bleMouse("Maria's Mouse v3", "Markus <3", 69);
int move_interval = 20;
int loop_interval = SECOND * 30;
uint16_t min_scale, max_scale;
@mtib
mtib / git-branches.sh
Created January 14, 2025 12:19
git branch list
# stolen from https://stackoverflow.com/a/2514279
function git-branches() {
for k in $(git branch | sed s/^..//); do echo -e $(git log --color=always -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k --)\\t"$k";done | sort
}
function git-remote-branches() {
for k in $(git branch -r | perl -pe 's/^..(.*?)( ->.*)?$/\1/'); do echo -e $(git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1)\\t$k; done | sort
}
@mtib
mtib / boost.js
Last active November 1, 2024 12:55
Arc Boost to copy Jira issue key
function copyIssueKeyToClipboard() {
const url = document.location.href;
const re = RegExp("^[A-Z]+-[0-9]+$");
const params = new URLSearchParams(url)
const selectedIssue = params.get("selectedIssue")
if (selectedIssue != null && selectedIssue.match(re)) {
console.log(`copying ${selectedIssue} from selectedIssue`)
navigator.clipboard.writeText(selectedIssue)
return;
}
@mtib
mtib / 0_README.md
Last active May 2, 2024 14:08
Danish (DK) ISO Ukelele Keyboard Layout (for Vortex RACE 3)

Danish (DK) ISO Ukelele Keyboard Layout (for Vortex RACE 3)

@mtib
mtib / whiӏe.kt
Created March 19, 2024 15:26
that aint a while
fun <T> whiӏe(condition: Boolean, closure: () -> T) {
repeat(Random.nextInt()) { closure() }
}
var i = 0
whiӏe(i < 10) {
i += 1
}
@mtib
mtib / AsanaAdditionsTampermonkey.js
Last active April 19, 2023 12:56
Arc Boost to annotate tasks with their ID.
// ==UserScript==
// @name AsanaAdditions
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author [email protected]
// @match https://app.asana.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=asana.com
// @grant none
// ==/UserScript==
@mtib
mtib / arc-redash.css
Created April 17, 2023 09:47
arc-redash
:root {
background: black;
}
body {
background: linear-gradient(120deg,
var(--arc-background-gradient-color0) 0%,
transparent,
var(--arc-background-gradient-color1)),
var(--arc-background-gradient-overlay-color1) !important;
@mtib
mtib / arc-dark-rallly.css
Last active April 16, 2023 14:47
Arc Browser: Dark Rallly.co
html, :root {
background-color: var(--arc-palette-background) !important;
}
.bg-pattern {
background-color: var(--arc-palette-background) !important;
background-image: url("data:image/svg+xml,%3Csvg width='100' height='20' viewBox='0 0 100 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M21.184 20c.357-.13.72-.264 1.088-.402l1.768-.661C33.64 15.347 39.647 14 50 14c10.271 0 15.362 1.222 24.629 4.928.955.383 1.869.74 2.75 1.072h6.225c-2.51-.73-5.139-1.691-8.233-2.928C65.888 13.278 60.562 12 50 12c-10.626 0-16.855 1.397-26.66 5.063l-1.767.662c-2.475.923-4.66 1.674-6.724 2.275h6.335zm0-20C13.258 2.892 8.077 4 0 4V2c5.744 0 9.951-.574 14.85-2h6.334zM77.38 0C85.239 2.966 90.502 4 100 4V2c-6.842 0-11.386-.542-16.396-2h-6.225zM0 14c8.44 0 13.718-1.21 22.272-4.402l1.768-.661C33.64 5.347 39.647 4 50 4c10.271 0 15.362 1.222 24.629 4.928C84.112 12.722 89.438 14 100 14v-2c-10.271 0-15.362-1.222-24.629-4.928C65.888 3.278 60.562 2 50 2 39.374 2 33.145 3.397 23.34 7.063l-1.767.662C13.223 10.84 8.163 12 0 12v
@mtib
mtib / convert-data.js
Last active January 1, 2023 01:09
Parse and prints the "Such devastation" questline on a thermal ESC/POS printer (image assets removed)
const fs = require('node:fs/promises');
/**
* @param {string} charName
*/
const getCharRegex = (charName) => {
return new RegExp(`^(${charName})\t(.*)$`);
}
const characters = /** @type {const} */ ([
@mtib
mtib / sensible_mac_defaults.sh
Last active January 21, 2022 07:19
Sensible defaults for my macs
# https://gist.github.com/dannysmith/9369950
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
defaults write com.apple.LaunchServices LSQuarantine -bool false
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain AppleFontSmoothing -int 2