Skip to content

Instantly share code, notes, and snippets.

// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
{
"from": 0,
"size": 12,
"query": {
"bool": {
"should": [
{
"bool": {
"should": [
{
const dotenv = require("dotenv");
const fs = require("fs");
const os = require("os");
const _ = require("lodash");
const unirest = require('unirest');
dotenv.config({ silent: true });
var API_KEY = process.env.FRESHDESK_API_KEY;
var FD_ENDPOINT = process.env.FRESHDESK_DOMAIN;
@shoaibmerchant
shoaibmerchant / pointClickEvent
Created February 24, 2016 13:41
Double Click
var _pointClickEvent = function(event){
var openZAxis = function(){
if(self.zAxisChartEnabled() === true && !self.customMapJsonEnabled()){
_callZAxisChart();
}
}
var startDrilldown = function(_event){
if(self.mapVisualization() !== 'mapbubble'){
@shoaibmerchant
shoaibmerchant / replace.js
Created December 15, 2015 11:17
Grunt Process to Rename icons8 classes
grunt.config.set('replace', {
icons8: {
files: {
'<%= config.lessDir %>/build/icons.less': '<%= config.lessDir %>/templates/icons.build.less'
},
options: {
patterns: [
{
match: new RegExp('icons8', 'g'),
replacement: 'storedock'
module.exports.models = {
updateOrCreate: function (criteria, values) {
var deferred = q.defer();
var self = this;
this.findOne(criteria)
.then(function (data) {
if (!data || data === null) {
self.create(values)
.then(function (data) {
console.log('created');