Skip to content

Instantly share code, notes, and snippets.

Remco Tolsma remcotolsma

Block or report user

Report or block remcotolsma

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
View lookup-query-henk.sql
SELECT
t.*,
d.*
FROM
(
SELECT
`company_code`,
`company_name` as `CompanyName`,
`period_start_date` as `Begindatum`,
`period_end_date` as `Einddatum`,
View dita-addresses-to-json.php
<?php
$addresses = array();
foreach ( $data as $item ) {
$addresses[] = (object) array(
'company' => 'First Company',
'address' => 'First Address',
'city' => 'First City',
'postcode' => 'First Postal',
@remcotolsma
remcotolsma / tbs-posts-accommodation-ids.sql
Created Feb 8, 2019
Tommy Booking Support WordPress posts accommodation ID's.
View tbs-posts-accommodation-ids.sql
SELECT
wp_posts.ID,
wp_posts.post_title,
wp_postmeta.meta_value
FROM
wp_posts
LEFT JOIN
wp_postmeta
ON (
wp_posts.ID = wp_postmeta.post_id
@remcotolsma
remcotolsma / index.php
Created Jan 28, 2019
Check if all files within a range are in a directory.
View index.php
<?php
global $argv;
$dir = __DIR__;
if ( isset( $argv[1] ) ) {
$dir = $argv[1];
}
@remcotolsma
remcotolsma / functions.php
Last active Jan 25, 2019
WordPress query to retrieve active Pronamic Pay subscriptions for current user.
View functions.php
<?php
/**
* WordPress query to retrieve active Pronamic Pay subscriptions for current user.
*
* @link https://github.com/ApiGen/ApiGen
* @link https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query
* @link https://github.com/woocommerce/woocommerce/wiki/wc_get_products-and-WC_Product_Query
*/
@remcotolsma
remcotolsma / pronamic-pay-export-payments-gravityforms-entries.sql
Last active Jan 3, 2019
Export completed Pronamic Pay payments with Gravity Forms entries.
View pronamic-pay-export-payments-gravityforms-entries.sql
SELECT
post.ID,
post.post_title,
post.post_date,
post.post_status,
MAX( IF( meta.meta_key = "_pronamic_payment_description", meta.meta_value, NULL ) ) AS payment_description,
MAX( IF( meta.meta_key = "_pronamic_payment_entrance_code", meta.meta_value, NULL ) ) AS payment_entrance_code,
MAX( IF( meta.meta_key = "_pronamic_payment_language", meta.meta_value, NULL ) ) AS payment_language ,
MAX( IF( meta.meta_key = "_pronamic_payment_amount", meta.meta_value, NULL ) ) AS payment_amount,
MAX( IF( meta.meta_key = '_pronamic_payment_currency', meta.meta_value, NULL ) ) AS payment_currency,
@remcotolsma
remcotolsma / exiftool-date-folders.sh
Last active Nov 22, 2018
ExifTool group images in date folders
View exiftool-date-folders.sh
# 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 Sep 28, 2018
Pronamic Pay - Payment Item
View example.php
<?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 Sep 27, 2018
HTML 4.01 Frameset full
View index.html
<!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 Sep 24, 2018
Subversion status, AWK and Subversion delete.
View requirements.sh
# 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
You can’t perform that action at this time.