Skip to content

Instantly share code, notes, and snippets.


Jonathon Hill compwright

View GitHub Profile
compwright / query.sql
Created Sep 18, 2020
Legacy membership migration query
View query.sql
SELECT AS client_id, AS client_name,
DATE(MAX(orders.time_stamp)) AS last_order,
clients.program AS program_id, AS program_name, AS last_invoice_id, AS last_invoice_amount,
membership_invoice.payment_method AS last_invoice_payment_method,
membership_invoice.notes AS last_invoice_notes,
compwright / fieldedge.json
Created May 8, 2020
FieldEdge field configuration
View fieldedge.json
"name": "quoteNumber",
"label": "Quote Number",
"type": "string",
"exampleValue": ""
"name": "quotedAmountSubtotal",
"label": "Quoted Amount Subtotal",
compwright / template.html
Last active Apr 20, 2020
Email template with responsive text
View template.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style type="text/css">
* {
compwright / inject.php
Created Oct 22, 2019
PHP Dependency Injection in <10 lines
View inject.php
function inject (array $container, $class, $method) {
$args = array_map(
function (ReflectionParameter $arg) {
return $arg->getName();
(new ReflectionMethod($class, $method))->getParameters()
compwright /
Last active Dec 12, 2019
AnomalyInnovations/serverless-bundle test case
compwright / client_automations.sql
Last active Oct 30, 2018
View client_automations.sql
INSERT INTO `client_automations` (`client`, `source`, `status`, `credentials`, `rules`, `exclusions`, `created_timestamp`, `updated_timestamp`, `user`)
(452,'servicetitan','active','{\"apiKey\":\"\",\"apiSecret\":\"\"}','[{\"settings\":{\"products\":[{\"code\":\"1\",\"qty\":1}],\"location\":\"7\",\"department\":null,\"cardType\":\"TY\"},\"conditions\":[{\"id\":\"0voXy6RCReZjFoa8HOQSi\",\"field\":\"\",\"operator\":\"isMoreThan\",\"operand\":\"1.00\",\"operandType\":\"number\"}],\"isActive\":true,\"id\":\"v4sQi7iJJLl~FpKYAlaah\"}]',NULL,'2018-10-29 17:28:36','2018-10-29 17:34:14',2304),
compwright /
Last active Sep 26, 2018
Javascript Disenchantment

Only in software, it’s fine if a program runs at 1% or even 0.01% of the possible performance. Everybody just seems to be ok with it....our portable computers are thousands of times more powerful than the ones that brought man to the moon. Yet every other webpage struggles to maintain a smooth 60fps scroll on the latest top-of-the-line MacBook Pro. --Nikita Prokopov, [Software disenchantment][1]

He is right!

Two questions immediately came to mind:

  1. Why do we write such bloated, inefficient software?
  2. How can we do better?
View gist:7aff180840b1a17861cbaf227e9e103e
"_id" : ObjectId("58e2a3047463f61e5de6dbd6"),
"updatedAt" : ISODate("2017-04-03T19:31:16.681Z"),
"createdAt" : ISODate("2017-04-03T19:31:16.681Z"),
"name" : "Test calendar",
"active" : true,
"webhooks" : [
"url" : "http://localhost:8082/api/rdc/webhooks/scheduler",
"signatureAlgorithm" : "x-hub",
compwright / prerequest.js
Created Sep 30, 2016
Postman pre-request script for Joyent Signature Authentication Scheme
View prerequest.js
// Postman pre-request script for Joyent Signature Authentication
// (
// Set the following vars in your Postman environment:
// apiHost
// apiKey
// apiSecret
// Set the following headers in Postman (copy/paste):
// Authorization: Signature keyId="{{apiKey}}",algorithm="hmac-sha256",headers="host date",signature="{{signature}}"
compwright / ChromePluginCompiler.php
Last active Aug 30, 2016
PHP build script for a Google Chrome browser extension
View ChromePluginCompiler.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';
You can’t perform that action at this time.