Skip to content

Instantly share code, notes, and snippets.

View amcolash's full-sized avatar

Andrew McOlash amcolash

View GitHub Profile
@amcolash
amcolash / steam-deck-install.sh
Last active September 2, 2022 23:05
An install script to set up developer tools on steam deck
#!/bin/bash
### Steam Deck dev tools install script ###
# This script needs to be run as root
if [ "$EUID" -ne 0 ]
then echo "Please run this script as root (with sudo)"
exit
fi
@amcolash
amcolash / index.js
Created August 7, 2021 20:21
Tampermonkey script to copy colors from SchemeColor.com
// ==UserScript==
// @name SchemeColor.com Copy Button
// @namespace http://tampermonkey.net/
// @version 0.1
// @description copy color palette from SchemeColor
// @author Andrew McOlash
// @match https://www.schemecolor.com/*
// @icon https://www.google.com/s2/favicons?domain=schemecolor.com
// @grant GM_setClipboard
// ==/UserScript==
@amcolash
amcolash / convert.py
Last active May 19, 2021 15:11
Python script to convert images for "The World's Worst Video Card" by Ben Eater
from PIL import Image
import struct
# Options to set up
file = "iceland.jpg"
dither = True
showPreview = True
# Palette code based off of https://stackoverflow.com/a/29438149/2303432
@amcolash
amcolash / index.js
Last active July 25, 2020 19:16
Merge IP blocklists
/* Simple node script to merge 2 IP blocklists into a single one for use with Synology */
const fs = require('fs');
const path = require('path');
function makeSet(file) {
const split = file.split(/\r?\n/);
const set = new Set();
split.forEach(ip => set.add(ip));
@amcolash
amcolash / extend_tiles.sh
Last active June 11, 2020 07:20
Tile extension script (add padding to a tileset/spritesheet)
#!/bin/bash
# Add padding to a tileset. This script assumes that the input file is a png
# Usage: extend_tiles.sh [image_file.png] [width] [height] [new_width] [new_height] [columns]
# 1 2 3 4 5 6
if [ "$#" -ne 6 ]; then
echo Usage: extend_tiles.sh [image_file.png] [width] [height] [new_width] [new_height] [columns]
exit 1
fi
@amcolash
amcolash / Tuxedo InfinityBook.md
Last active March 21, 2023 13:20
Notes on how I set up my Tuxedo Infinity Book S 14 v5

Setting Up Tuxedo InfinityBook S 14 v5

Add Tuxedo Repo + Install Tuxedo Drivers/Utils

All of the Tuxedo stuff seems to be optional and this laptop has fantasic support out of the box w/ Xubuntu.

To add the repos, make a source list for the tuxedo repos sudo vim /etc/apt/sources.list.d/tuxedo-computers.list

Add the following (for now, until updated)

@amcolash
amcolash / flowkey.js
Last active August 7, 2023 14:50
UPDATE, see here: https://github.com/amcolash/flowkey-scraper - Noteflight auto transcribe
// Find the sheet music images on the page
const elements = document.getElementsByClassName('split-image');
// Check that there are actually images on the page
if (elements.length === 0) {
console.error('No images found');
} else {
// If images were found, extract the base url from the 1st one
const imageUrl = elements[0].src;
const imageIdMatch = /\/sheets\/([\w\d]+)\//;
@amcolash
amcolash / ATTiny + Micronucleus
Last active April 23, 2024 21:28
ATTiny85 + micronucleus using an AVR programmer
This gist is a list of instructions that I used to program my ATTiny85s with Micronucleus. They worked for me, but your mileage may vary! I would highly recommend starting by looking at the SparkFun article linked at the bottom for schematics and more in-depth info. This gist is mostly just a copy/paste list.
## Required:
- ATTiny85
- AVR programmer
- 1 uF capacitor
- Micronucleus FW: https://github.com/micronucleus/micronucleus/releases
- avrdude: http://www.nongnu.org/avrdude/
## Setup:
@amcolash
amcolash / scrape.js
Last active December 8, 2023 19:27
A tapermonkey script to scrape linkedin job listings
// ==UserScript==
// @name LinkedIn Scraper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author Andrew McOlash
// @match https://www.linkedin.com/jobs/search/*
// @grant none
// ==/UserScript==
@amcolash
amcolash / README.md
Last active March 21, 2017 14:47
Translate a directory of files w/ node

This is a simple node application that will convert a path of files into english names. It does not translate directory names.

You will need to add in your own google translation api key by defining translateKey. Additionally, you will need to run npm install google-translate to the place that you copied translate.js so that you have the translation api dependency.

I made this function synchronous (for better or for worse) using promises to make sure it is all done before continuing on.

Free to use or modify however you want!