Skip to content

Instantly share code, notes, and snippets.

Jeremy Nagel jeznag

  • COzero
  • Sydney
Block or report user

Report or block jeznag

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2e9651442e58aff4b2cb3ba54ece89b2
// ==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 / attachFilesToZohoCRM
Created Sep 10, 2017
Uploading files to Zoho CRM using Node.js
View attachFilesToZohoCRM
const request = require('request');
function attachFileToCRM(crmContactID) {
const urlForFileToAttach = 'http://example.com/blah.pdf';
const CRM_UPLOAD_FILES_URL = `https://crm.zoho.com/crm/private/json/Contacts/uploadFile?authtoken=${CRM_AUTH_TOKEN}&scope=crmapi&id=${crmContactID}`;
// You can use fs.createReadStream for local files
const readStream = request.get(urlForFileToAttach);
const formData = {
content: {
@jeznag
jeznag / test.js
Created May 6, 2019
sun-energy-green-energy
View test.js
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 Jan 19, 2019
Example Zoho CRM widget to allow TSV data downloads
View app.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
[data-download] {
color: blue;
}
[data-download][href="#"] {
@jeznag
jeznag / gist:a47fefa0d491a8a73956a345d1a4c51e
Created Jul 13, 2018
Deluge code for creating purchase order based on sales order
View gist:a47fefa0d491a8a73956a345d1a4c51e
sales_order_record = zoho.crm.getRecordById("Sales_Orders",sales_order_id.toLong());
products = sales_order_record.get("Product_Details");
account_id = sales_order_record.get("Account_Name").getJSON("id");
account_record = zoho.crm.getRecordById("Accounts", account_id.toLong());
products_list = products.toJSONList();
products_for_purchase_order = List:Map();
grand_total = 0.0;
total_without_tax = 0.0;
@jeznag
jeznag / gist:536c64ac94f762f8057633113b0a79ae
Created Nov 25, 2017
custom related list in Zoho CRM
View gist:536c64ac94f762f8057633113b0a79ae
string getProductsFromPurchaseorder(string purchase_order_id)
{
purchase_order_record = zoho.crm.getRecordById("PurchaseOrders",input.purchase_order_id.toLong());
line_items = purchase_order_record.get("product").toJSONList();
xml_for_related_list = "<record>";
idx = 0;
for each line_item in line_items
{
line_item_map=line_item.toMap();
xml_for_related_list=((xml_for_related_list + ("<row no='" + idx + "'><FL val='product name'>" + line_item_map.get("Product Name")) + "</FL><FL val='quantity'>") + line_item_map.get("Quantity")) + "</FL></row>";
@jeznag
jeznag / gist:eb53f5742c6f9cebf3b6752b04fd25e2
Last active Mar 31, 2019
Automatically associating products to potential in Zoho CRM
View gist:eb53f5742c6f9cebf3b6752b04fd25e2
AUTH_TOKEN = "CHANGEME";
quote_record = zoho.crm.getRecordById("Quotes", quote_id);
quote_products = quote_record.get("product").toJSONList();
related_products = zoho.crm.getRelatedRecords("Products", "Potentials", input.deal_id.toString());
row_index = 1;
xml_data = "<Products>";
for each product in quote_products {
product_map = product.toMap();
info product_map;
xml_data += "<row no=\"" + row_index + "\"><FL val=\"PRODUCTID\">" + product_map.get("Product Id") + "</FL></row>";
View gist:e7d7b0a432b57e478e09bb59a60223cb
htmlpage FilteredRides(ignore_lat, chosen_event, userLat, userLong, userDestLat, userDestLong, userOriginLocation, userOriginState, userDestState, userDestLocation, Travel_Mode)
content
<%{
if(input.userLong == null && input.userLat == null && input.ignore_lat != "yes")
{
%>
Could not find those locations in Google Maps. Try re-entering the addresses.
<%
}
else if((input.userLong != null && input.userLat != null) || input.ignore_lat == "yes")
@jeznag
jeznag / gist:2fb9466adeb5c302668f
Last active Feb 20, 2019
Bulk updating thousands of Zoho CRM records
View gist:2fb9466adeb5c302668f
//trick to do a while loop in Deluge script
lst_iterator = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
for each iterator in lst_iterator{
//can get 200 records at a time. range is like 1-200, 201-300, etc.
start_index = 200 * iterator + 1;
end_index = start_index + 199;
//find leads that don't have updated notes
leads_without_updated_notes = zoho.crm.searchRecords("Leads", "(Notes migrated|=|false)", start_index, end_index);
for each lead in leads_without_updated_notes
{
@jeznag
jeznag / submitform.tsx
Last active Aug 14, 2018
full submit button component
View submitform.tsx
import React, { Component } from 'react';
import { Consumer as I18nConsumer } from '@App/I18nContext';
import { i18n } from 'i18next';
import { connect } from 'react-redux';
import AttemptSubmitActionCreator from '@App/RequestData/redux/action-creators/attemptSubmit';
import { IStoreState } from '@Redux/storeGenerator';
You can’t perform that action at this time.