Skip to content

Instantly share code, notes, and snippets.

View benjaminalldridge's full-sized avatar

Benjamin Alldridge benjaminalldridge

View GitHub Profile
@benjaminalldridge
benjaminalldridge / replace_encode_json.md
Created January 11, 2024 02:53
Find and replace JSON::encode_json calls in Perl Dancer2

JSON::encode_json\s*(({[^{}](?:{[^{}]}[^{}])}))

send_as JSON => $1

/**
* Validate a provided ABN via 3 methods: numerically, via API, and (optionally) mathematically
*
* @param {string} abn The ABN to validate. White space is trimmed at runtime.
* @returns {bool}
*/
function validateAbn(abn) {
// ABR requires a guid to access the API