Skip to content

Instantly share code, notes, and snippets.

@sli
sli / jiggler.rs
Last active November 27, 2023 07:39
Mouse jiggler for an rp2040
#![no_std]
#![no_main]
use adafruit_kb2040 as bsp;
use defmt_rtt as _;
use panic_halt as _;
use bsp::{
entry, hal,
@sli
sli / install-chatterino.sh
Last active May 15, 2022 23:46
Automated Chatterino install.
#!/bin/bash
# This script adapted from the compilation guide here:
# https://github.com/Chatterino/chatterino2/blob/master/BUILDING_ON_LINUX.md
# Install dependencies, including a library required on RasPi/ARM Linux that is
# not listed in the compilation docs (libatomic)
sudo apt install -y qttools5-dev qtmultimedia5-dev libqt5svg5-dev libboost-dev \
libssl-dev libboost-system-dev libboost-filesystem-dev cmake g++ \
libatomic-ops-dev
@sli
sli / gitlab-firacode.user.js
Last active December 6, 2019 18:35
A userscript to enable ligatures (using Fira Code) on <code> blocks and Monaco Editors.
// ==UserScript==
// @name Browser Fira Code
// @version 1
// @grant none
// ==/UserScript==
const GM_addCssResource = href => {
const head = document.getElementsByTagName('head')[0]
if (!head) { return }
@sli
sli / datagrid.cljs
Created October 7, 2019 01:29
Datagrid Base
; https://github.com/borkdude/draggable-button-in-reagent/blob/master/src-cljs/drag/main.cljs
(def columns
[{:key :one :display "One"}
{:key :two :display "Two"}
{:key :three :display "Three"}
{:key :four :display "Four"}
{:key :five :display "Five"}])
(def cell-renderers
@sli
sli / telegramdark.user.js
Last active October 1, 2019 16:59
Telegram web dark mode
// ==UserScript==
// @name Telegram dark theme / night mode
// @namespace https://github.com/digitalheir/
// @version 1.0
// @description Dark theme / night mode for Telegram Web
// @author Maarten Trompper <maartentrompper@freedom.nl>
// @match https://web.telegram.org/*
// ==/UserScript==
// Since GM removed it (https://wiki.greasespot.net/GM_addStyle)
@sli
sli / blueprint-core.cljs
Last active October 3, 2019 03:40
Blueprint.js for CLJS
(ns beard-oil.lib.blueprint.core
(:require ["@blueprintjs/core" :as bpc]
[camel-snake-kebab.core :refer [->kebab-case-keyword]]
[camel-snake-kebab.extras :refer [transform-keys]]))
(def ^:private constant
(comp
(partial transform-keys ->kebab-case-keyword)
js->clj))
@sli
sli / cool_image.cljs
Last active July 4, 2019 23:51
Chainable SVG library demo.
(ns svg.core
(:require [reagent.core :refer [render-component]]
[svg.lib.core :as s]))
(def sand-color "#efc58d")
(defn cool-image
[]
(-> (s/svg {:view-box "0 0 100 100"
:stroke "none"
@sli
sli / config.h
Last active June 8, 2019 23:34
DZ60RGB QMK Keymap
#pragma once
#define sli60
const handler = {
get: (obj, prop) => {
// Call should be run when calling invoke().
if (prop === 'invoke') {
return body => console.log(`Would call ${obj.route} with body: ${JSON.stringify(body)}`)
}
// First access sets the request method.
if (obj.route === null) {
return (new Proxy({ route: '', method: prop }, handler))
@sli
sli / sortAnything.js
Last active November 12, 2018 18:00
bubble sort
const makeCourse = (code, name) => ({ code, name })
const makeHonors = (course, section, semester) => ({ course, section, semester })
const courses = [
makeCourse(220, 'D Two Two Zero'),
makeCourse(110, 'A One One Zero'),
makeCourse(130, 'C One Three Zero'),
makeCourse(120, 'B One Two Zero')
]