Skip to content

Instantly share code, notes, and snippets.

View pkage's full-sized avatar
🛠️
writing

Patrick Kage pkage

🛠️
writing
View GitHub Profile
@pkage
pkage / orbit.py
Last active September 18, 2023 05:10
orbital sim to show why dot product disambiguates position in orbit
# adapted from:
# https://astronomy.stackexchange.com/questions/7806/exercise-2d-orbital-mechanics-simulation-python
import matplotlib.pyplot as plt
import math
plt.ion()
plt.style.use('dark_background')
@pkage
pkage / main.c
Created July 15, 2023 15:43
spi 20x6bit -> 20x8bit unstuff
#include <stdio.h>
#include <stdlib.h>
// assumes little endian
void print_bits(size_t const size, void const * const ptr)
{
unsigned char *b = (unsigned char*) ptr;
unsigned char byte;
int i, j;
@pkage
pkage / aws_presigned_url_reqpays.py
Last active April 27, 2023 19:44
RequesterPays presigned URL failure with AWS4-HMAC-SHA256
import boto3
from botocore.client import Config
client = boto3.client(
's3',
'us-west-2',
# replace with your credentials
aws_access_key_id='AWS_ACCESS_KEY_ID',
aws_secret_access_key='AWS_SECRET_ACCESS_KEY',
@pkage
pkage / draftmode.tex
Created December 14, 2021 18:20
Patrick's draft mode latex thing
\usepackage{xcolor}
\usepackage{framed}
\usepackage{ifthen}
\newboolean{draftenabled}
\setboolean{draftenabled}{false} % change to enabled to show notes
\ifthenelse{\boolean{draftenabled}}
{
\newenvironment{draft}{
@pkage
pkage / init.vim
Created May 8, 2021 10:56
2021 vim config
set nocompatible
call plug#begin('~/.local/share/nvim/plugged')
" Quality of life
Plug 'tpope/vim-sensible'
Plug 'vim-airline/vim-airline'
Plug 'scrooloose/nerdtree'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'mhinz/vim-startify'
@pkage
pkage / Dockerfile
Created October 23, 2020 07:21
Dockerfile for ROS over noVNC
FROM dorowu/ubuntu-desktop-lxde-vnc:bionic-lxqt
RUN \
apt-get update && \
apt-get install -y \
dirmngr \
python3-pip && \
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' && \
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 && \
apt-get update && \
@pkage
pkage / .zshrc
Created June 18, 2020 00:57
06.17.2020 dotfiles dump
autoload bashcompinit
bashcompinit
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd
bindkey -v
@pkage
pkage / thumbnail_browser.html
Last active April 13, 2020 05:54
clicky clicky
<!DOCTYPE html>
<html>
<head>
<title>foo</title>
</head>
<body>
<img id="big"/>
<div id="thumbs"></div>
@pkage
pkage / .zshrc
Created August 1, 2019 21:53
work dotfiles
# quality of life stuff
alias l="ls -AFG"
alias ll="ls -AFGhl"
alias res="cd ~/Repositories"
alias ..="cd .."
alias ...="cd ../.."
alias .="source"
# text editor setup
alias vi="nvim"
@pkage
pkage / userChrome.css
Created June 27, 2019 01:32
completely remove top tabs in firefox
/* tree style tab stuff */
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar > .toolbar-items {
opacity: 0;
pointer-events: none;
}
#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
visibility: collapse !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
display: none;