Skip to content

Instantly share code, notes, and snippets.

View rgson's full-sized avatar
🐛

Robin Gustafsson rgson

🐛
View GitHub Profile
@rgson
rgson / golf_without_your_friends.py
Last active September 18, 2022 10:02 — forked from demus/golf_without_your_friends.py
Auto putt script for Golf With Your Friends (http://store.steampowered.com/app/431240/) Master Putter achievement
import ctypes
import time
user32 = ctypes.windll.user32
# https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mouse_event
MOUSEEVENTF_MOVE = 0x0001
MOUSEEVENTF_LEFTDOWN = 0x0002
MOUSEEVENTF_LEFTUP = 0x0004
@rgson
rgson / unpack-unitypackage.sh
Last active December 27, 2020 15:45
Unpack .unitypackage files
#!/bin/sh
set -e
if [ -z "$1" ]; then
echo "Usage: $0 FILE.unitypackage" >&2
exit 1
fi
tmp=$(mktemp -d)
tar -C "$tmp" -x -f "$1"
@rgson
rgson / keybase.md
Created November 28, 2019 18:37
keybase.md

Keybase proof

I hereby claim:

  • I am rgson on github.
  • I am rgson (https://keybase.io/rgson) on keybase.
  • I have a public key whose fingerprint is B26C 2ED3 7324 6221 9C3D 1DFE 293A 3C91 D188 369C

To claim this, I am signing this object:

@rgson
rgson / README.md
Created November 23, 2018 23:58
Delete Discord messages

Discord Eraser

Erases all of your messages in a DM conversation.

Usage

  1. Open Chrome Dev Tools > Network.
  2. Go to https://discordapp.com.
  3. Find some request with the Authorization request header.
  4. Place the header's value in the Authorization variable in eraser.js.
@rgson
rgson / picsum-wallpapers.sh
Last active March 10, 2019 22:30
Lorem Picsum Wallpapers (Cinnamon)
#!/bin/sh
set -e
# Sets your wallpaper to a random photo from <https://picsum.photos>.
# Run regularly (e.g. automatically on login) to keep your desktop fresh.
cache="${XDG_CACHE_HOME:-$HOME/.cache}/picsum-wallpapers"
mkdir -p "$cache"
new="$cache/new.jpg"
@rgson
rgson / youtube-playlist-duration.js
Created February 9, 2019 21:16
Calculates the total duration of a YouTube playlist.
/*
Calculates the total duration of a YouTube playlist.
Run the snippet in Chrome Dev Tools while on the playlist's page,
e.g. https://www.youtube.com/playlist?list=WL
Ensure that the playlist is fully visible first.
Long playlists are loaded 100 videos at a time.
*/