Skip to content

Instantly share code, notes, and snippets.

View peterdemartini's full-sized avatar
😎
being awesome

Peter DeMartini peterdemartini

😎
being awesome
View GitHub Profile
@peterdemartini
peterdemartini / command.sh
Last active March 28, 2024 17:49
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@peterdemartini
peterdemartini / sugar_send_email.php
Created December 20, 2013 16:47
SugarCRM Send Email via PHP
<?php
function send_report_email($subject, $body, $emails){
require_once('include/SugarPHPMailer.php');
$emailObj = new Email();
$defaults = $emailObj->getSystemDefaultEmail();
$mail = new SugarPHPMailer();
$mail->setMailerForSystem();
@peterdemartini
peterdemartini / jshintrc.txt
Last active June 12, 2019 20:08
My .jshintrc for Node.js and clean JavaScript
{
"passfail": false, // Stop on first error
"maxerr": 100, // Maximum error before stopping
"node": true, // Enable globals available when code is running inside of the NodeJS runtime environment.
"browser": true, // Standard browser globals e.g. `window`, `document`.
"esnext": true, // Allow ES.next specific features such as `const` and `let`.
"bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.).
"camelcase": false, // Permit only camelcase for `var` and `object indexes`.
"curly": false, // Require {} for every new block or scope.
"eqeqeq": true, // Require triple equals i.e. `===`.
{
"message": "what is the current version of meshblu?"
}
curl \
--fail \
--location \
--silent \
--data '{"name":"Meshblu Connector Say Hello","connector":"meshblu-connector-say-hello","type":"device:say-hello","githubSlug":"octoblu/meshblu-connector-say-hello","version": "latest"}' \
--request POST \
--header 'Content-Type: application/json' \
--user 'my-octoblu-uuid:my-octoblu-token' \
'https://connector-service.octoblu.com/users/my-octoblu-connector-uuid/connectors'
{
"root": true,
"extends": [
"eslint:recommended",
"prettier"
],
"rules": {
"semi": [ 2, "never" ],
"no-undefined": "error"
},
http://localhost:3000/magic-link?uuid=6e0a26ac-765c-429a-bbe0-12fc7a97a80f&token=9ce75c5c6663bba7d14ba6ef120cadb23d9fb87a
@peterdemartini
peterdemartini / gist:1bbcb83a6fcf02f6a92fa28337e22fc6
Created January 10, 2017 22:19
Find slow queries from compose mongo logs
zgrep -E ".*keysExamined.*[0-9]{3,}ms" mongodb82.log-2017-01-08.gz
@peterdemartini
peterdemartini / one-liner.js
Last active November 28, 2016 17:17
SumTotalHack
m_objCurrentSco.TimeSession = `0000:${(Math.floor(Math.random() * (30 - 10 + 1)) + 10)}:${Math.floor(Math.random() * 55)}`; m_objCurrentSco.ScoreRaw = "100"; m_objCurrentSco.LessonStatus = "completed"; API.SetTotalTime(); API.SetPostComplete(true)
Trigger {Name}
Trigger hello {Name}
Trigger hi {Name}
Trigger start {Name}
Trigger open {Name}
Trigger trigger {Name}
Trigger {Name} there is a problem
Trigger {Name} I need help
Trigger {Name} {SymptomPrefix} {Symptom}
Trigger tell the {Name} {SymptomPrefix} {Symptom}