Skip to content

Instantly share code, notes, and snippets.

View npfitz's full-sized avatar

Nick Fitzpatrick npfitz

  • Metabase
  • Fredericton, NB
View GitHub Profile
var request = require('request'),
_ = require('lodash'),
fs = require('fs');
var url = 'https://na78.salesforce.com/services/data/v39.0/sobjects/Attachment',
token = '00Do0000000Kwd1!ARwAQGh714_EED_D.HqUk_3R2aZaJrEqpeZi2MnHChCWXmU6IxSRs6RN8SBbcX5He_Bt4rUz8EHDo5.ncCioQBd0p_vfmqzm',
CRLF = '\r\n';
var sfRequest = request({
{
"en":{
"1":{
"title":"True colours",
"feature-name":"Ambient Lighting",
"landing-color":"white",
"url":"true-colours",
"is-new":true,
"is-standard":false,
"copy":"Colour is scientifically proven to affect your mood. With ambient lighting you can enhance the joy of every drive - whether it's yellow when you need a little sunshine, or green on your way to a nature hike",
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say voice="woman">Whatup ma nittas? Leave me a message</Say>
<Record maxLength="20" playBeep="true" action="http://3e6208e6.ngrok.io"/>
</Response>
<Response>
<Dial callerId="15063003242">
<User>sip:[email protected]</User>
</Dial>
</Response>
var foundItem = _.findWhere(scope.items, {content: scope.currentText});
if(foundItem){
scope.ngModel = foundItem.value;
}
@npfitz
npfitz / popup.js
Created April 7, 2016 17:16
My version of joint.ui.popup
'use strict';
var $ = require('jquery');
var joint = require('rappid');
var _ = require('lodash');
function popup(){
joint.ui.Popup2 = joint.ui.ContextToolbar.extend({
var self = this;
palette.load([
new joint.shapes.liveOps.event({
name: 'none',
entity: 'start'
}),
new joint.shapes.liveOps.event({
name: 'none',
entity: 'catch'
}),
"[{"rendering-data":{"x":800,"y":80},"children":["ff4b5a29-2637-4c5e-b464-4ca54bf890b9"],"parents":["07d36d5f-6612-46c2-a0a3-8fae6e65087c"],"id":"b36323f2-947a-43ac-93cc-95228e60880b","type":"task","entity":"activity","name":"add-participant","params":{"customer":{"source":"expression","value":"customer"},"muted":{"source":"expression","value":"false"},"disconnectOn":{"source":"expression","value":""}},"bindings":{},"target":"twilio"},{"rendering-data":{"x":800,"y":200},"children":["0f3ff723-5c49-433b-9fe7-b046b7b7d5a1"],"parents":["b36323f2-947a-43ac-93cc-95228e60880b"],"id":"ff4b5a29-2637-4c5e-b464-4ca54bf890b9","entity":"catch","type":"signal","interrupting":true,"target":"customer-conversation-end","bindings":{}},{"rendering-data":{"x":800,"y":320},"children":[],"parents":["ff4b5a29-2637-4c5e-b464-4ca54bf890b9"],"id":"0f3ff723-5c49-433b-9fe7-b046b7b7d5a1","entity":"throw","type":"terminate","terminate":true},{"rendering-data":{"x":642.5,"y":80},"children":["b36323f2-947a-43ac-93cc-95228e60880b"],"parents"
onCellChange: function(eventName, cell, change, opt) {
opt = opt || {};
// Do not react on changes that happened inside this inspector. This would
// cause a re-render of the same inspector triggered by an input change in this inspector.
if (opt.inspector == this.cid) return;
// Note that special care is taken for all the transformation attribute changes
// (`position`, `size` and `angle`). See below for details.
(function() {
'use strict';
var flowSetup = function($http, AuthService) {
return {
seed: function(email, password) {
var TITAN_REGION_ID;
var TITAN_ADMIN_ID;
var CREATED_USER_ID;
var CREATED_USER_EMAIL;