Skip to content

Instantly share code, notes, and snippets.

View jcdk's full-sized avatar
🟢
Available

Christo de Klerk jcdk

🟢
Available
View GitHub Profile
@jcdk
jcdk / wepaycsv2qfx.py
Created February 11, 2023 00:24
WePay CSV to QFX conversion script in python. Just change the filenames and run the script in the same folder as your input csv. With some modification, this script will allow you to prep a QFX file for MoneyMinder import from a payment processor like WePay that doesn't provide QFX files.
import csv
from datetime import datetime
# Open the CSV file
with open('wepay-input.csv', 'r') as csvfile:
# Create a reader object
reader = csv.DictReader(csvfile)
# Open the QFX file
with open('wepay-output.qfx', 'w') as qfxfile:
@jcdk
jcdk / batch-resize
Last active February 11, 2023 00:25
Batch resize from command line all jpg image files proportionately to max 1050px width recursively from current directory
find -iname "*.jpg" -type f -exec identify -format '%w %h %i\n' '{}' \; | awk '$1>1050' | sed 's/.* //' | sudo mogrify -resize 1050x\> @-
@jcdk
jcdk / error_log
Last active January 19, 2018 18:19
Process and order errors in apache error_log by the most commonly repeated
grep 'on line' error_log | cut -d' ' -f11-34 | sort | uniq -c | sort -n
@jcdk
jcdk / functions.php
Last active March 1, 2017 01:35
Want visitors to be able to contact your Wordpress users via their profile pages? This is how to add a custom mail-tag for the Contact Form 7 plugin that gets the email address on a profile page of the profiled author/user's email address for use as the send to email address. Past this into functions.php and then set the contact form's To field …
// Adds custom mail tag to WPCF7 that gets the email address on a profile page of the profiled author/user.
function custom_wpcf7_special_mail_tag( $output, $name, $html ) {
$name = preg_replace( '/^wpcf7\./', '_', $name ); // for back-compat
$submission = WPCF7_Submission::get_instance();
if ( ! $submission ) {
return $output;
}
if ( '_url' == $name ) {