Skip to content

Instantly share code, notes, and snippets.

View rpavlik's full-sized avatar

Rylie Pavlik rpavlik

View GitHub Profile
@rpavlik
rpavlik / makerbot_rep2x_1st.def.json
Last active October 17, 2022 19:32 — forked from d235j/makerbot_rep2x_1st.def.json
Replicator 2X Cura definition - slightly tweaked for my printer, which is running Sailfish
{
"id": "makerbot_rep2x_1st",
"version": 2,
"name": "Rep2X Right Extruder",
"inherits": "fdmextruder",
"metadata": {
"machine": "makerbot_replicator_2x",
"position": "0"
},
@rpavlik
rpavlik / install-fonts.ps1
Created July 22, 2022 15:36
sample powershell script to install fonts
# Note that there is actually a "fonts" bucket in scoop that makes this obsolete in this specific case
$FontRelease = "2111.01"
$FontArchive = "CascadiaCode-${FontRelease}.zip"
wget.exe "https://github.com/microsoft/cascadia-code/releases/download/v$FontRelease/$FontArchive"
# -aoa = always overwrite
7z x -oCascadiaCode -aoa "${FontArchive}"
# https://blog.simontimms.com/2021/06/11/installing-fonts/
$fonts = (New-Object -ComObject Shell.Application).Namespace(0x14)
@rpavlik
rpavlik / fix_homebrew.rb
Created January 6, 2011 20:32 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@rpavlik
rpavlik / GetRenderManager.cmd
Last active February 23, 2022 11:53
Batch script for keeping an up-to-date local copy of the latest 32 and 64-bit continuous builds of OSVR RenderManager and OSVR Core
@echo off
rem By Ryan Pavlik, Sensics, Inc. <http://sensics.com/osvr>
rem Copyright 2015-2016 Sensics, Inc.
rem SPDX-License-Identifier: Apache-2.0
rem Put this in a directory of its own, preferably. It will create one file and two subdirectories.
rem Doesn't hurt to run it more often than there are builds: it won't re-download (though
rem it will harmlessly re-extract)
rem Requires that you have wget and 7za (the command line version of 7z) in your path.
@rpavlik
rpavlik / script.sh
Created March 1, 2018 17:24
Reading 24xx i2c eeprom using rpi or other linux board
# Make sure you have i2c-dev loaded and set up for whatever interface you're using
# This is the right one for the default rpi interface.
cd /sys/class/i2c-adapter/i2c-1/
# Instantiate a new device at runtime
# use the right generic chip name (24cSOMETHING) - don't screw this up! see
# table at https://elixir.bootlin.com/linux/v4.14.18/source/drivers/misc/eeprom/at24.c#L136
# description further up at https://elixir.bootlin.com/linux/v4.14.18/source/drivers/misc/eeprom/at24.c#L30
# and info about what this command actually does at
# https://elixir.bootlin.com/linux/v4.14.18/source/Documentation/i2c/instantiating-devices#L207
echo 24c16 0x50 | sudo tee new_device
@rpavlik
rpavlik / ring-buffer-with-all-iterators.h
Last active December 7, 2021 21:41
Ring buffer impl with all iterators
// Copyright 2021, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Ringbuffer implementation for keeping track of the past state of things
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
* @author Moses Turner <moses@collabora.com>
* @ingroup aux_util
*/
@rpavlik
rpavlik / code.py
Created November 30, 2021 15:24
Adafruit EyeLights Digital Rain
# SPDX-FileCopyrightText: 2021 Phil Burgess for Adafruit Industries
# SPDX-FileCopyrightText: 2021, Ryan Pavlik <ryan.pavlik@gmail.com>
#
# SPDX-License-Identifier: MIT
import math
import random
import time
from supervisor import reload
import board
@rpavlik
rpavlik / rules.txt
Created January 5, 2018 16:13
Stop CNet Auto-Play Videos
! Block annoying CNet auto-play videos.
! Tried to make it targeted so that if you actually wanted to watch a video, you could...
! Tested/works with uBlock Origin
! Block the playlist
www.cnet.com/videos/manifest/*.m3u8?device=ott*
! Block the script that loads the playlists
*.cbsistatic.com/fly/js/pages/desktop/article_video_test*.js
! Element hiding: hide the now-useless placeholder
www.cnet.com##.entered.dock.inviewElement
@rpavlik
rpavlik / adafruit_displayio_sh1107_wrapper.py
Last active August 13, 2021 17:02
Adafruit MacroPad with my mods
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2020 Mark Roberts for Adafruit Industries
# SPDX-FileCopyrightText: 2021 James Carr
# SPDX-FileCopyrightText: 2021 Ryan Pavlik
#
# SPDX-License-Identifier: MIT
"""
`adafruit_displayio_sh1107_wrapper`
================================================================================
@rpavlik
rpavlik / aq-funhouse.py
Last active August 1, 2021 02:36
air quality on funhouse/clue
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Melissa LeBlanc-Williams for Adafruit Industries
# SPDX-FileCopyrightText: 2021, Ryan Pavlik <ryan.pavlik@gmail.com>
# SPDX-License-Identifier: MIT
try:
from typing import Optional
except ImportError:
pass