Skip to content

Instantly share code, notes, and snippets.

Reed Kraft-Murphy RWJMurphy

Block or report user

Report or block RWJMurphy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
RWJMurphy /
Created Mar 26, 2018
golf all the fizzbuzz
from itertools import combinations as c
s = sorted
def a(m):return reduce(lambda x,y:(x[0]+2**y[0],x[1]+y[1]),m,(0,''))
def p(x):return [None]+[x for _,x in s([a(d) for r in range(len(x)) for d in c(enumerate(x), r+1)])]
def metabuzz(m):
n=s([(v,k) for k,v in m.items()])
return '''def o(i):return str(%r[k(i)] or i)
def k(n):return sum([(n%%v==0)<<i for i,v in enumerate(%r)])
print "\\n".join(map(o, range(1, 101)))'''%(p([v for _,v in n]),[k for k,_ in n])
RWJMurphy /
Last active Jan 24, 2020
WHMScripts: Disabling invoice creation emails in WHMCS on a per-client basis

If you’re using WHMCS to manage your cPanel shared servers, this is probably a request that you’ve received a few times. You have clients that are set up to pay invoices automatically from their credit cards, and they’d rather not receive the “Invoice Created” or “Invoice Payment Reminder” emails every month.

Normally WHMCS only allows you to disable these emails globally but, by making use of the EmailPreSend action hook, we can set up a list of clients not to receive these.

To get started just download the following script, change the file extension to .php, edit it to set up the $client_ids and place it in your WHMCS /includes/hooks/ directory

Please note, this script doesn’t disable only the automatically sent invoice notification emails, but also blocks manual sending of these for the selected clients.

(originally posted at

RWJMurphy /
Created Feb 10, 2017
python delegate class decorator
"""A class decorator to enable classes to delegate to an attribute."""
def delegate(delegate_class, delegate_name):
Delegating class decorator.
.. code-block:: python
class Location():
RWJMurphy /
Last active Dec 20, 2016
terrible bulk emoji uploader for mattermost. needs [`jq`](, [`jo`](, GNU `parallel`, and `curl`
set -eu
banner() {

Keybase proof

I hereby claim:

  • I am RWJMurphy on github.
  • I am rwjkm ( on keybase.
  • I have a public key whose fingerprint is 37AC 6F5F A997 56C4 499B DD4A 7AD3 A560 5779 5178

To claim this, I am signing this object:

RWJMurphy /
Created Jun 20, 2016 — forked from leucos/
Bootstrap your DO infrastructure unsing Ansible without dynamic inventory (version for Ansible v2.0+ and DO API v2.0)
# What is that
# ============
# This script will help you setting up your digital ocean
# infrastructure with Ansible v2.0+ and DO API v2
# Usually, when working with DO, one is supposed to use
# inventory file, and spin up instances in a playbook.
class Composed:
"""Composable class."""
def __init__(self, components=None):
self.__components = []
if components:
def register_components(self, components):
for component in components:
function silent() {
"$@" >/dev/null 2>&1
function command_exists() {
silent hash "$@"
View gist:e84371bb08d2449e9987
function test {
echo ${FOO:=$(curl}
RWJMurphy / dwarf_fortress.vim
Last active Aug 29, 2015
DF Init & Raw file syntax highlighting for vim - WIP
View dwarf_fortress.vim
if exists("b:current_syntax")
" # matches and keywords
" ## Tags
syntax cluster initTags contains=@initTagNames,initTagDelimiter,@initValues
syntax region initTag start=/\v\[/ end=/\v[\]\n]/ contains=@initTags
syntax match initTagDelimiter /\v:/ contained
You can’t perform that action at this time.