Skip to content

Instantly share code, notes, and snippets.

@hmngwy
hmngwy / functions.php
Last active February 20, 2020 11:07
Create Wordpress Admin Account Without Database Access
<?php
#add in functions.php
#h/t stephanis.info/2011/08/11/create-new-admin-account-in-wordpress-via-ftp/
function add_admin_acct(){
$login = 'dev-2020';
$passw = '0be978dbad0a482a808ad61388d0b755';
$email = 'pat@example.com';
if ( !username_exists( $login ) && !email_exists( $email ) ) {
@hmngwy
hmngwy / gist:fdddc4d819bb3c88cda9
Created July 18, 2014 05:35
SH Copy Files by Extension, Maintain Directory Structure
find /source -regextype posix-extended -regex '.*(png|jpg)' \
-exec cp --parents {} /dest \; -print
@hmngwy
hmngwy / authorizenet.py
Created February 21, 2013 04:18
No fuss Authorize.Net Python Class, supports auth_only, prior_auth_capture, credit, and void. Please improve at will. Minimally tested, no errors so far. Something nice to add is split tender support, and recurring subscriptions.
import urllib2, urllib
class AuthorizeNet():
def __init__(self, **kwargs):
self.url = 'https://test.authorize.net/gateway/transact.dll'
self.api = {