Skip to content

Instantly share code, notes, and snippets.

View weskerfoot's full-sized avatar

Wesley Kerfoot weskerfoot

View GitHub Profile
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
import board
import lib.adafruit_ht16k33.matrix as M
i2c = board.I2C()
matrix = M.Matrix8x8(i2c)
matrix.fill(0)
matrix.brightness = 0.1
matrix.blink_rate = 0
# glider
matrix[2,2] = 1
static void
motor_timer_cb(TimerHandle_t timer) {
struct rpm_state rotations_left;
xQueuePeek(motor_rpm_q_handle_left, &rotations_left, (TickType_t)1);
struct rpm_state rotations_right;
xQueuePeek(motor_rpm_q_handle_right, &rotations_right, (TickType_t)1);
if (rotations_right.avg > 0 && rotations_right.cur > 0) {
rotations_right.avg = (rotations_right.avg + rotations_right.cur) / 2;
source /opt/homebrew/Cellar/fzf/0.38.0/shell/completion.bash
source /opt/homebrew/Cellar/fzf/0.38.0/shell/key-bindings.bash
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
export PYENV_ROOT="$HOME/.pyenv"
export EDITOR=vim
LS_COLORS=$LS_COLORS:'di=0;35:' ; export LS_COLORS
set guifont=Menlo:h23
set encoding=utf-8
set tabpagemax=100
scriptencoding utf-8
set guitablabel=\[%N\]\ %t\ %M
execute pathogen#infect()
"set smartindent
#include QMK_KEYBOARD_H
#include "print.h"
#include <stdint.h>
/* The following defines the configuration for the UART driver. */
/*!
* UART BAUD rate. This is the speed that we transmit at. For the 1MHz
* RC clock, 4800 is the maximum speed (out of the "standard" ones) that
* will work. If you're running at 8MHz or with an external crystal, you
import board
import busio
import digitalio
import adafruit_hid as hid
import adafruit_ble
from adafruit_ble.advertising import Advertisement
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.standard.hid import HIDService
from adafruit_ble.services.standard.device_info import DeviceInfoService
from adafruit_hid.keyboard import Keyboard
@weskerfoot
weskerfoot / gist:c624670f3d46def1609553ead28bbf78
Last active September 27, 2022 18:23
Systemd unit file to manage starting barrier through flatpak, with the correct options
[Unit]
Description=Barrier
After=graphical.target
StartLimitIntervalSec=400
StartLimitBurst=3
[Service]
Type=simple
ExecStart=/usr/bin/flatpak run -p --command="barrierc" com.github.debauchee.barrier --no-restart --no-tray --no-daemon --debug INFO --name steamdeck 192.168.0.221
Restart=always
#! /usr/bin/env python
import requests
import cairosvg
import click
from io import BytesIO
from PIL import Image as PILImage
from urllib.parse import quote
from pixcat import Image
def get_png(tex):
@weskerfoot
weskerfoot / life.py
Last active November 9, 2021 19:10
Game of Life on the adafruit circuit playground for an 8x8 led matrix
import board
import lib.adafruit_ht16k33.matrix as M
i2c = board.I2C()
matrix = M.Matrix8x8(i2c)
matrix.fill(0)
matrix.brightness = 0.1
matrix.blink_rate = 0
# glider
matrix[2,2] = 1