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
jeznag / SpecialFormTest.php
Last active Aug 29, 2015
Connecting PHPUnit with PhantomJS
View SpecialFormTest.php
include_once 'TestScaffold.php';
class SpecialFormTest extends TestScaffold
public function testTitle() {
$this->url('http://localhost/special_form/public/' );
jeznag / TestScaffold.php
Last active Sep 19, 2017
Combine PhantomJS with PHPUnit
View TestScaffold.php
class TestScaffold extends \PHPUnit_Extensions_Selenium2TestCase {
protected function setUp() {
$this->setBrowser( 'phantomjs' );
$this->setBrowserUrl( '' );
View Person.js
import DS from 'ember-data';
import Ember from 'ember';
var inflector = Ember.Inflector.inflector;
inflector.irregular('person', 'people');
inflector.singular(/person/, 'person');
let Person = DS.Model.extend({
fullName: DS.attr( 'string' ),
View gist:6d08233bd3af27761a9e
"people": [
"name": "Oliver Oldham",
"location": "Sydney Australia",
"description": "Enterprise Technologist in Cloud and Infrastructure. General Manager of the Cloud Practice @ Telstra, critical thinker and Jumps from perfectly good planes.",
"photo": ""
"name": "Tim Love",
jeznag / actual JSON payload
Created May 17, 2015
Actual JSON payload from Kimono
View actual JSON payload
"name": "followerwonk",
"count": 50,
"url": "",
"results": {
"people": [
"name": "[Name redacted]",
"location": "Sydney Australia",
"description": "Enterprise Technologist in Cloud and Infrastructure. General Manager of the Cloud Practice @ Telstra, critical thinker and Jumps from perfectly good planes.",
jeznag / person.js
Created May 17, 2015
Person deserializer
View person.js
import DS from 'ember-data';
import config from '../config/environment';
var counter = 1;
export default DS.RESTSerializer.extend({
extractSingle: function(store, type, payload, id) {
var people = payload.results.people;
payload = {
jeznag / gist:62f22aa9b7a54d7ed107
Created May 22, 2015
Get profile details for Zoho CRM user using deluge script
View gist:62f22aa9b7a54d7ed107
//get details for this user
userResp = getUrl((""));
info userResp;
users = userResp.executeXPath("/users/user");
if ((users != null) && (users != "")) {
userList = users.toList("-|-");
for each user in userList {
idNode = user.executeXPath("/user/@id");
id = idNode.executeXPath("/id/text()");
if (id == ownerId) {
jeznag / gist:836b3963f4398531e99f
Created May 22, 2015
Mass update lookups in Zoho CRM using custom function
View gist:836b3963f4398531e99f
void update_vendor_lookup (int finance_equity_id)
finance_equity_obj = zoho.crm.getRecordById("CustomModule4", finance_equity_id);
lender_string = finance_equity_obj.get("Lender");
lender_id = 0;
if (lender_string.contains("Adelaide")){
//figure out appropriate lookup value based on picklist
lender_id = 1002375000002270019;
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 / gist:7e12bf5c68a36ad44fbd
Created May 31, 2015
Update amount for Zoho CRM potential based on related products
View gist:7e12bf5c68a36ad44fbd
potential_obj = zoho.crm.getRecordById("Potentials", potential_id);
related_products = zoho.crm.getRelatedRecords("Products", "Potentials", potential_id.toString(), 1,200);
total_amount = 0.0;
for each product in related_products {
total_amount = total_amount + product.get("Unit Price").toDecimal();
potential_obj.put("Amount", total_amount);
potential_obj.put("Populate amount based on products associated", false);
You can’t perform that action at this time.