Skip to content

Instantly share code, notes, and snippets.

View user8446's full-sized avatar

Glenn Fowler user8446

View GitHub Profile
@sean-m
sean-m / TimeEstimator.ps1
Last active December 4, 2023 22:15
A time estimator for use with PowerShell's Write-Progress. Provided a total number of cycles, it tracks how long the last 100 or less itterations of your main loop took and calculates the remaining time based on velocity. Note: when ticks exceed total, it returns a seconds remaining of 0, but continues to track the rate that work is getting done.
<#
A time estimator for use with PowerShell's Write-Progress. Provided a total
number of cycles, it tracks how long the last 100 or less itterations of your
main loop took and calculates the remaining time based on velocity. Note: when
ticks exceed total, it returns a seconds remaining of 0, but continues to track
the rate that work is getting done.
The intended use case is with Write-Progress, calls to that cmdlet are really
slow on PowerShell 2-5, efforts have been made to maintain low overhead. If
you're after performance this is still useful, just log the progress yourself.
For instance, using [System.Diagnostics.Trace]::Write() and watching with
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active May 4, 2024 07:54
Make Firefox fast again
@jamietre
jamietre / docker-compose.yml
Last active March 17, 2024 23:11
Script to start WSL and bind localhost to WSL IP
# Example docker-compose.yml for plex.
version: "2"
services:
plex:
image: plexinc/pms-docker:plexpass
runtime: nvidia
container_name: "plex"
restart: always
hostname: "MY-PLEX"
volumes:
@svbergerem
svbergerem / nextcloud-deck-export-import.py
Created June 24, 2020 09:50
Nextcloud Deck Export/Import
import requests
urlFrom = 'https://cloud.domainfrom.tld'
authFrom = ('username', 'password')
urlTo = 'https://nextcloud.domainto.tld'
authTo = ('username', 'password')
headers={'OCS-APIRequest': 'true', 'Content-Type': 'application/json'}
@drmohundro
drmohundro / pdf-to-txt.sh
Created December 16, 2017 17:34
GhostScript PDF to text stdout
# requires ghostscript to be installed first - on mac, install with `brew install ghostscript`
# -sDEVICE=txtwrite - text writer
# -sOutputFile=- - use stdout instead of a file
# -q - quiet - prevent writing normal messages to output
# -dNOPAUSE - disable prompt and pause at end of each page
# -dBATCH - indicates batch operation so exits at end of processing
gs -sDEVICE=txtwrite -sOutputFile=- -q -dNOPAUSE -dBATCH to-be-processed.pdf
@lg
lg / angry_wifi.sh
Last active November 28, 2023 23:56
auto disconnects clients with a low signal strength on LEDE / OpenWRT
#!/bin/ash
#
# angry_wifi.sh
#
# auto disconnects clients with a low signal strength on LEDE / OpenWRT. great
# for clients who hold onto a lower-signal-strength accesspoint instead of
# roaming. before running, make sure to download the latest MAC addresses with:
#
# wget --no-check-certificate -O - 'https://services13.ieee.org/RST/standards-ra-web/rest/assignments/download/?registry=MAC&text=apple' | cut -d, -f2 > apple_mac_addresses
#

So since the API really desn't work as you'd expect it to, I am documenting this here at least.

I created a testing board with cards A, B, C, ... , M so I can test on it.

First, grabbing all cards works as expected.

api.find(:boards, '56af532ae7a74a5fcac32e66').cards.map { |c| [c.name, c.id] }

=> [
 ["A", "56af53367f15b163c0e345fd"],

["B", "56af533783d4fccc1cce3941"],

@bamanzi
bamanzi / firefox-prefs.js.md
Last active May 19, 2023 09:34
Firefox preference tweaks