Skip to content

Instantly share code, notes, and snippets.

View nickrouty's full-sized avatar

Nick Routsong nickrouty

  • Routy Development LLC
  • Arizona
View GitHub Profile
class ExampleSingleton {
private $properties = array();
private static $instance;
private __construct(){}
public getInstance()
{
if (empty(self::$instance)) {
@nickrouty
nickrouty / functions.php
Created December 12, 2017 04:07
Filter/Customize the Order number for Chase Paymentech WooCommerce XML API Gateway by Routy Development to append the last 4 numbers of the WooCommerce Order ID.
function rd_set_custom_order_id_for_chase_paymentech( $order_id, $order ) {
return uniqid() . '-' . substr($order->get_id(), -4);
}
add_filter( 'chase_paymentech_gateway_transaction_order_id', 'rd_set_custom_order_id_for_chase_paymentech', 10, 2 );
@nickrouty
nickrouty / rd-class-text-extraction.php
Created May 9, 2018 04:14
Class for extraction the text from doc, docx, xlsx, pptx and wrapper for 3rd party pdf to text library.
<?php
/**
* Class RD_Text_Extraction
*
* Example usage:
*
* $response = RD_Text_Extraction::convert_to_text($path_to_valid_file);
*
* For PDF text extraction, this class requires the Smalot\PdfParser\Parser class.
@nickrouty
nickrouty / example-ion-input-getInputElement.js
Created August 3, 2021 16:42
How to retrieve the native element underlying an IonInput component in React
const passwordInput = useRef<HTMLIonInputElement>(null);
passwordInput.current?.getInputElement().then( (element) => {
if ( element.value ) {
setPassword(element.value);
}
});