Skip to content

Instantly share code, notes, and snippets.

View compwright's full-sized avatar

Jonathon Hill compwright

View GitHub Profile
@compwright
compwright / Process_Manager.php
Created December 5, 2012 04:10
Demo code used in my "Multitasking in PHP" presentation at the December 2012 Atlanta PHP user group meetup
<?php
class Process_Manager implements Countable
{
protected $processes = array();
protected $is_child = FALSE;
public function count()
{
return count($this->processes);
@compwright
compwright / ChromePluginCompiler.php
Last active March 13, 2023 08:59
PHP build script for a Google Chrome browser extension
<?php
class ChromePluginCompiler extends PluginCompiler
{
// constants - set these in your subclass
public $major_version = '5.0';
public $browser = 'chrome';
protected $output_mime_type = 'application/x-chrome-extension';
protected $output_filename = 'ChromeExtension.crx';
protected $build_dir = 'chrome';
Order Progress: 0.1%, 0 Failed, Time: 5s, Memory: 337.48MB
Order Progress: 0.1%, 0 Failed, Time: 6s, Memory: 337.43MB
Order Progress: 0.1%, 0 Failed, Time: 7s, Memory: 337.46MB
Order Progress: 0.1%, 0 Failed, Time: 8s, Memory: 337.77MB
Order Progress: 0.1%, 0 Failed, Time: 10s, Memory: 337.45MB
Order Progress: 0.1%, 0 Failed, Time: 11s, Memory: 337.45MB
Order Progress: 0.1%, 0 Failed, Time: 12s, Memory: 337.46MB
Order Progress: 0.1%, 0 Failed, Time: 13s, Memory: 337.48MB
Order Progress: 0.2%, 0 Failed, Time: 14s, Memory: 337.46MB
Order Progress: 0.2%, 0 Failed, Time: 15s, Memory: 337.51MB
@compwright
compwright / ServiceTitan-BusinessUnit-898-Client-6850.json
Created August 2, 2021 16:22
Example of large Business Unit data
{
"id": 898,
"active": true,
"name": "HVAC Service",
"officialName": "4 Service Pros",
"email": "info@4servicepros.com",
"currency": "USD",
"phoneNumber": "(703) 444-0000",
"invoiceHeader": "4 Service Pros\n7000 Newington Rd. \nSuite E\nLorton, VA 22079\n703-444-0000\nwww.4servicepros.com\ninfo@4servicepros.com",
"invoiceMessage": "Thank you for your business and the opportunity to serve you. If you have any questions please call our office at 703-444-0000.",
@compwright
compwright / Page 1 URL (decoded).txt
Created July 8, 2021 14:59
TYS history page error
https://office.toyoursuccess.com/crm/1321/history?filter=1&pg=2&q=&cat[]=accounting&cat[]=automation&cat[]=customer_relations&cat[]=graphics&cat[]=nuturing_dashboard&cat[]=order_generation&cat[]=order_processing&cat[]=purchasing&cat[]=sales&type[]=note&type[]=phone&type[]=voicemail&type[]=email&type[]=text&type[]=online&type[]=mail&type[]=drip+automation&type[]=other&type[]=in-person&type[]=task&type[]=file&assigned[]=6342&assigned[]=6347&assigned[]=6348&assigned[]=6350&assigned[]=6351&assigned[]=6352&assigned[]=6359&assigned[]=6360&assigned[]=6361&assigned[]=6362&assigned[]=6363&assigned[]=6364&assigned[]=6367&assigned[]=6368&assigned[]=6370&assigned[]=6371&assigned[]=6372&assigned[]=6373&assigned[]=6376&assigned[]=6377&assigned[]=6378&assigned[]=6383&assigned[]=6384&assigned[]=6392&assigned[]=6393&assigned[]=6395&assigned[]=6397&assigned[]=6399&assigned[]=6401&assigned[]=6402&assigned[]=6403&assigned[]=6404&assigned[]=6405&assigned[]=6406&assigned[]=6407&assigned[]=6408&assigned[]=6409&assigned[]=6410&assig
@compwright
compwright / H3194.md
Last active May 4, 2021 19:05
H.3194 of 2021 (Santee Cooper) version

House Amendment 2a

Reps. LUCAS, G.M. SMITH, SIMRILL, RUTHERFORD, FINLAY and DAVIS propose the following Amendment No. to H. 3194 (COUNCIL\ZW\3194C005.CC.ZW21):

Reference is to Printer's Date 4/22/21-S. Amend the bill, as and if amended, by striking all after the enacting words and inserting: / Part 3 SECTION 1.Chapter 31, Title 58 is amended by adding: "Article 7 Retail Rates Process Section 58-31-710. The Public Service Authority, through its board of directors, shall adopt and publish pricing principles that respect and balance factors including, but not limited to, adherence to the authority's mission to be a low-cost provider, reliability, transparency, preservation of the authority's financial integrity, equity among customer classes, gradualism in adjustments to its pricing and rate schedule type, encouragement of efficiency and demand response, adequate notice to customers, and relief mechanisms for financially distressed customers. The authority shall also maintain and continue to offer rate sche

@compwright
compwright / production.log
Last active April 22, 2021 22:24
#1625 Migrate Business Unit Name
[ec2-user@ip-172-31-29-39 ~]$ php /opt/toyoursuccess/app/scripts/fix/fix_automation_rules.php
Migrating servicetitan settings for Air Conditioning Services (ACS)
*** Rule #1 ***
*** Rule #2 ***
*** Rule #3 ***
*** Rule #4 ***
*** Exclusions ***
@compwright
compwright / bill.md
Created April 12, 2021 17:05
H3510 vs S201 of 2021

124th Session, 2021-2022

S. 201

STATUS INFORMATION

General Bill

Sponsors: Senator Hembree

@compwright
compwright / run.log
Last active April 1, 2021 14:20
tys_quickbooks_replay.log
[ec2-user@ip-172-31-29-39 ~]$ php /opt/toyoursuccess/app/scripts/import/quickbooks.php --export-invoice=171102
############################
# Quickbooks export script #
############################
Exports accounting records to QuickBooks via the QuickBooks Web Connector
2021/04/01 10:01:57 [/opt/toyoursuccess/app/scripts/import/quickbooks.php] Exporting Invoice #171102
Script ran for [ec2-user@ip-172-31-29-39 ~]$ php /opt/toyoursuccess/app/scripts/import/quickbooks.php --export-invoice=171661
############################
@compwright
compwright / query.sql
Created September 18, 2020 15:39
Legacy membership migration query
SELECT
clients.id AS client_id,
clients.name AS client_name,
DATE(MAX(orders.time_stamp)) AS last_order,
clients.program AS program_id,
programs.name AS program_name,
membership_invoice.id AS last_invoice_id,
membership_invoice.total AS last_invoice_amount,
membership_invoice.payment_method AS last_invoice_payment_method,
membership_invoice.notes AS last_invoice_notes,