Skip to content

Instantly share code, notes, and snippets.

View nick2687's full-sized avatar

Nick Clark nick2687

View GitHub Profile
@reinvented
reinvented / pdoc.php
Last active May 7, 2024 12:49
Automating the use of Canada Revenue's Payroll Deductions Online Calculator in PHP
<?php
/**
* get-pdoc.php - Scrape Canada Revenue Agency payroll deductions values
*
* This script takes an hourly amount, a number of hours, and a year,
* month and day of a pay period ending, and passes these to the
* Canada Revenue Agency Payroll Deductions Online Calculator
* (https://www.canada.ca/en/revenue-agency/services/e-services/e-services-businesses/payroll-deductions-online-calculator.html),
* returning the provincial tax, federal tax, CPP and EI amounts.
*
@christianhanvey
christianhanvey / modx-snippets.php
Last active June 14, 2023 13:02
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@splittingred
splittingred / .htaccess
Created April 9, 2012 21:48
Example of how to use new REST server class in MODX 2.3+
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L]
</IfModule>