Skip to content

Instantly share code, notes, and snippets.

View remcotolsma's full-sized avatar
🏢
Working @pronamic

Remco Tolsma remcotolsma

🏢
Working @pronamic
View GitHub Profile
@remcotolsma
remcotolsma / exiftool-date-folders.sh
Last active November 22, 2018 20:24
ExifTool group images in date folders
# https://sno.phy.queensu.ca/~phil/exiftool/faq.html#Q5
exiftool -d "%Y-%m-%d" -DateTimeOriginal -S -s *.JPG
# -TAG or --TAG Extract or exclude specified tag
# -d FMT (-dateFormat) Set format for date/time values
# -s[NUM] (-short) Short output format
# -S (-veryShort) Very short output format
# https://ninedegreesbelow.com/photography/exiftool-commands.html
@remcotolsma
remcotolsma / example.php
Last active September 28, 2018 13:50
Pronamic Pay - Payment Item
<?php
// `vat` or `tax`
// `amount` or `price`
// `including`, `inclusive` or `inc`
// `excluding`, `exclusive` or `exc`
$item = new Item();
$item->get_total_price_including_tax();
@remcotolsma
remcotolsma / index.html
Created September 27, 2018 07:27
HTML 4.01 Frameset full
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Pronamic.nl</title>
</head>
<frameset>
<frame src="https://www.pronamic.nl/">
</frameset>
@remcotolsma
remcotolsma / requirements.sh
Last active September 24, 2018 12:05
Subversion status, AWK and Subversion delete.
# GNU tools on Mac.
# https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# GNU `cat`
brew install coreutils
# GNU `xargs`:
# https://superuser.com/questions/467176/replacement-for-xargs-d-in-osx
brew install findutils --with-default-names
@remcotolsma
remcotolsma / twinfield-bank-cash-book-experiment.php
Created June 19, 2018 09:09
Twinfield bank/cash books info experiment.
<?php
$post = get_post();
$account = new Pronamic\WordPress\Lookup\Account( $post );
$twinfield_post = $account->get_twinfield_post();
$office_code = get_post_meta( $post->ID, '_lookup_twinfield_office_code', true );
@remcotolsma
remcotolsma / Mollie Twinfield MT940.md
Created April 24, 2018 07:53
Convert Mollie MT940 files to Twinfield required notation.
@remcotolsma
remcotolsma / twinfield-test.php
Last active April 10, 2018 08:16
Twinfield test retrieving provisional transaction total.
<?php
$client = $this->plugin->get_client();
$xml_processor = $client->get_xml_processor();
$browser = new \Pronamic\WP\Twinfield\Browse\Browser( $xml_processor );
$office_code = get_option( 'twinfield_default_office_code' );
@remcotolsma
remcotolsma / orbis-projects-invoices-conversion.sql
Last active March 9, 2018 09:37
Orbis Projects invoices conversion.
INSERT
INTO
orbis_projects_invoices ( project_id, invoice_number )
SELECT
project.id,
project.invoice_number
FROM
orbis_projects AS project
LEFT JOIN
orbis_projects_invoices AS invoice
@remcotolsma
remcotolsma / functions.php
Last active December 17, 2017 20:29
WordPress custom endpoints and Breadcrumb NavXT.
<?php
/**
* WordPress custom endpoints breadcrumbs.
*/
class WordPressCustomEndpointsBreadcrumbs {
/**
* Setup.
*/
public function setup() {
<?php
$offset = 0;
$length = 0;
$data = array(
'1',
'2',
'3',
'4',