Skip to content

Instantly share code, notes, and snippets.

View Wheest's full-sized avatar
💭
🍐

Perry Gibson Wheest

💭
🍐
View GitHub Profile
@Wheest
Wheest / random_letters.py
Created September 27, 2021 20:33
Given a dictionary, and a desired fraction, return a list of random letters which at least the desired fraction of words in the dictionary begins with. Optionally, set some letters that *must* appear in the list of letters
#!/usr/bin/env python
import argparse
import string
from typing import List
from collections import Counter
import numpy as np
def main(args) -> List[str]:
@Wheest
Wheest / proof_of_work.py
Created April 19, 2020 08:18
Generate a proof of work for a custom input and prefix, using MD5
from hashlib import md5
import argparse
parser = argparse.ArgumentParser(description='Proof of work')
parser.add_argument('--input_string', default='chungus',
help='String to compute proof of work on')
parser.add_argument('--prefix', default='000',
help='Required prefix for PoW - longer is more difficult')
args = parser.parse_args()
@Wheest
Wheest / gif_rotate.sh
Created April 18, 2020 12:07
Rotate an animated gif by a chosen amount, while maintaining the animation
#!/bin/bash
# Rotate an animated gif by a chosen amount, while maintaining the animation
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` [rotation in degrees] [input file] [output file]"
exit 0
fi
ROTATION=$1
@Wheest
Wheest / unwind.patch
Created August 8, 2019 09:55
gcc-4.5 patch
--- gcc/config/i386/linux-unwind_old.h 2019-08-08 11:02:37.812459833 +0200
+++ gcc/config/i386/linux-unwind.h 2019-08-08 11:36:20.876351869 +0200
@@ -135,7 +135,7 @@
int sig;
struct siginfo *pinfo;
void *puc;
- struct siginfo info;
+ siginfo_t info;
struct ucontext uc;
} *rt_ = context->cfa;
setw -g mode-keys emacs # Use emacs keybindings in copy mode
setw -g status-keys emacs
set -g mouse on
# COPY & PASTE
# Copy tmux buffer to X clipboard
# bind -Tcopy-mode M-w send-keys -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c " . bind-key -n C-y run-shell "xclip -o | tmux load-buffer - ; tmux paste-buffer"
# run -b runs a shell command in background
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# sometimes, on my travels I find myself in an unfamilar land.
# maybe inside a whale like Jonah.
# or in a small corner of the howling halls of the giants in the sky
# so when this happens, I say a little incantation
# and a wee bit of home comes to me
# If not running interactively, don't do anything
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Wheest
Wheest / org-movie.el
Created May 8, 2019 17:04
Early version of Emacs org-mode based movie watch list manager
;;; org-movie.el --- An org-mode movie watch list utility
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

Keybase proof

I hereby claim:

  • I am wheest on github.
  • I am pezza (https://keybase.io/pezza) on keybase.
  • I have a public key ASDPXJo4DEpEiRoJErGaNxMkJL7KCYCRjk56-pUOc0R8Kwo

To claim this, I am signing this object: