Skip to content

Instantly share code, notes, and snippets.

@Laura7089
Laura7089 / hb_all_books_dl.js
Last active February 3, 2019 23:33 — forked from zuazo/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
Forked from https://gist.github.com/p0kR/95e05e689be4e59b1b8fb6e383b9e25a
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
Settings (chrome://settings) --> Advanced --> Privacy and security --> Content settings --> PDF documents --> Download PDF files instead of automatically opening them in Chrome --> Turn ON
#!/bin/bash
result=$(printf "$@" | sed "s/./||&||/g")
printf "Copied!\n"
printf "$result" | xclip -selection clipboard
@Laura7089
Laura7089 / m3upi_to_m3u8.py
Last active December 7, 2024 02:57
Script to convert the json-formatted ".m3upi" files that Pi Music Player (for android) uses for storage into standard m3u files.
#!/usr/bin/env python
# Unix only. Call with "./m3upi_to_m3u8.py [path to PiPlaylistSong.m3upi] [path to music directory on PC].
# This script assumes you have the same music in the folder you specify as in the Music folder on your phone. (You can mount your phone with mtpfs and point this script at the Music folder in that if you want)
# Change constants as needed below.
import json
import os
import sys
# The names you want the playlists to be saved under; Pi does not seem to export names, only IDs.
@Laura7089
Laura7089 / get_games.py
Last active November 15, 2020 17:33
Get steam games shared between accounts using custom urls/steamID64s. Requires https://pypi.org/project/steam/ and an API key, found at https://steamcommunity.com/dev/apikey.
#!/usr/bin/env python3
from os import environ, path
from sys import argv
from steam.steamid import SteamID
from steam.webapi import WebAPI
def get_api():
@Laura7089
Laura7089 / wekan_backup.sh
Last active February 18, 2022 16:21
Shell script to download raw JSON of a set of Wekan boards
#!/bin/bash
set -eo pipefail
# Based on https://wekan.github.io/api/v2.55/#wekan-rest-api
if [[ $# < 3 ]]; then
printf "Usage:
$0 <server address> <export directory> <board>...\n"
exit 1
@Laura7089
Laura7089 / PKGBUILD
Created February 25, 2022 02:58
`packer-plugin-ansible` patched to generate newer keys, https://github.com/hashicorp/packer-plugin-ansible/issues/69
# Maintainer: Laura Demkowicz-Duffy <[email protected]>
_pkgname=packer-plugin-ansible
pkgname=${_pkgname}-patch
pkgver=1.0.1
pkgrel=1
pkgdesc="Packer ansible plugin with patch applied"
arch=('x86_64')
url="https://github.com/hashicorp/packer-plugin-ansible/issues/69"
license=('MPL2')
depends=(ansible packer)
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "dajonaga/focaldesktop"
config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
@Laura7089
Laura7089 / EMFCamp 2022 Badge
Last active June 4, 2022 19:45
EMF 2022 Badge Programming Justfile, requires `just` and `hush` (installable with `cargo`)
set positional-arguments
BADGE_PATH := "/dev/ttyACM0"
PB := `pwd` + "/pyboard.py --no-soft-reset -d '" + BADGE_PATH + "'"
# Download and install
hatch app_name: (download app_name) && (flash app_name)
# Download an app from the hatchery
download app_name:
@Laura7089
Laura7089 / picotool.sh
Created July 8, 2022 01:48
Small `picotool` wrapper intended for use as a cargo runner
#!/bin/sh
set -eu
# To use as a cargo runner, set:
#
# [target.YOUR_TARGET_NAME]
# runner = "./picotool.sh" # or wherever you put this script
#
# in .cargo/config.toml
# YOUR_TARGET_NAME is probably thumbv6m-none-eabi for the pico
#!/bin/env python3
import re
from sys import argv, stderr
import requests
from bs4 import BeautifulSoup
from thefuzz import fuzz
SLUG_ELIMINATE = [
" ",