Skip to content

Instantly share code, notes, and snippets.

View jeznag's full-sized avatar

Jeremy Nagel jeznag

View GitHub Profile
@jeznag
jeznag / package_lambdas.sh
Created October 2, 2020 05:46
package fat handler
mkdir -p dist
tar -czvf dist/build_tag_model_lambda.tar.gz build_tagging_model.py
@jeznag
jeznag / Pipfile
Last active October 2, 2020 05:41
package dependencies
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pandas = "*"
sklearn = "*"
xgboost = "*"
"psycopg2_binary" = "*"
@jeznag
jeznag / slim_handler.py
Created October 2, 2020 05:36
lambda slim handler
from __future__ import unicode_literals
import boto3
import importlib
import inspect
import json
import logging
import os
import sys
import tarfile
!function(o) {
var d = null
, l = null;
function n(e) {
e = e || 10;
for (var t = "", a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", i = 0; i < e; )
t += a.charAt(Math.floor(Math.random() * a.length)),
i++;
return t
}
@jeznag
jeznag / gist:64453d74f4c28b46b8a6c23b5118c14c
Created August 12, 2020 01:16
send automated reply to first reply from lead
info has_replied_before;
if(has_replied_before.toString() == "false")
{
update_payload = {"Has_replied_before":true};
update_resp = zoho.crm.updateRecord("Leads",lead_id,update_payload);
// now SMS the lead back
lead_data = zoho.crm.getRecordById("Leads",lead_id);
// From: the Twilio number you will use to send the message
from_number = "+61 123 457 686";
// To: the number to which the SMS should be sent
@jeznag
jeznag / zoho crm function
Created June 13, 2020 08:56
Code for Zoho Flow to invoke Twilio SMS function
info lead_type;
lead_id = lead_id_str.toLong();
lead_data = zoho.crm.getRecordById("Leads",lead_id);
// From: the Twilio number you will use to send the message
from_number = "+61429357123";
// To: the number to which the SMS should be sent
to_number = lead_data.get("Phone");
// The To Name will appear in the SMS Message title, e.g. "Sent to John Smith on 23-Mar-2020"
to_name = lead_data.get("First_Name") + " " + lead_data.get("Last_Name");
// get the template ID from the URL of a template record
@jeznag
jeznag / function
Last active June 14, 2020 13:37
Code for Twilio incoming webhook zoho crm
crmAPIRequestMap = crmAPIRequest.toMap();
body = crmAPIRequestMap.get("body");
try
{
body_parts = body.toList("&");
message_body = "";
from_number = "";
message_sid = "";
to_number = "";
for each body_part in body_parts
@jeznag
jeznag / gist:2e9651442e58aff4b2cb3ba54ece89b2
Created November 4, 2019 11:00
hide distracting sites
// ==UserScript==
// @name Hide emails
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://mail.google.com/mail/u/0/
// @match *://abc.net.au
// @match *://facebook.com
// @match *://www.facebook.com
@jeznag
jeznag / test.js
Created May 6, 2019 23:17
sun-energy-green-energy
const request = require("request-promise");
const clientID =
"REDACTED";
const clientSecret =
"REDACTED";
async function createSTC() {
const timestamp = new Date().toISOString();
const signatureString = `GD:${clientID}${timestamp}${clientSecret}`;
const crypto = require("crypto");
@jeznag
jeznag / app.html
Created January 19, 2019 05:36
Example Zoho CRM widget to allow TSV data downloads
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
[data-download] {
color: blue;
}
[data-download][href="#"] {