I hereby claim:
- I am RWJMurphy on github.
- I am rwjkm (https://keybase.io/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:
| #!/bin/bash | |
| function test { | |
| echo ${FOO:=$(curl https://gist.githubusercontent.com/RWJMurphy/ded51ead3b153364099a/raw/348c26370e90b6c77a08a2e8fb3258fa6f1a7426/gistfile1.txt)} | |
| } | |
| test | |
| test |
| #!/bin/bash | |
| function silent() { | |
| "$@" >/dev/null 2>&1 | |
| } | |
| function command_exists() { | |
| silent hash "$@" | |
| } |
| class Composed: | |
| """Composable class.""" | |
| def __init__(self, components=None): | |
| self.__components = [] | |
| if components: | |
| self.register_components(components) | |
| def register_components(self, components): | |
| for component in components: |
| #!/bin/bash | |
| # | |
| # 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 digital_ocean.py | |
| # inventory file, and spin up instances in a playbook. |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| set -eu | |
| MM_URL="https://mm.example.org" | |
| API_URL="${MM_URL}/api/v3" | |
| LOGIN_URL="${API_URL}/users/login" | |
| USERS_ME_URL="${API_URL}/users/me" | |
| ADD_EMOJI_URL="${API_URL}/emoji/create" | |
| banner() { |
| """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(): |
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 http://whmscripts.net/whmcs/2011/disabling-invoice-creation-emails-in-whmcs-on-a-per-client-basis/)
| 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]) |