Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#post .js file contents to BaasBox to create plugin
#usage bash postBaasBoxPlugin.sh sample.js
#get fileName
fileName="$1"
#uncomment below line to read file contents to variable
#codeContent=$(<$fileName)
var getParseHeader = function () {
return {
"X-Parse-Application-Id": "ENTER_APP_ID",
"X-Parse-REST-API-Key": "ENTER_API_KEY",
"Content-Type": "application/json"
};
};
var getParseUrl = function (className) {
return "https://api.parse.com/1/classes/" + className;
@giastfader
giastfader / venues.fs.search.js
Last active September 3, 2015 12:22 — forked from soukron/venues.fs.search.js
Simple plugin for Baasbox to act as an API gateway for Foursquare venues API
/* script: venues.fs.search */
/* This script endpoint: /plugin/venues.fs.search */
on('install',function(installEvent){
var success = Box.DB.createCollection('venues-cache-queries');
var success = Box.DB.createCollection('venues-cache-answers');
return true;
});
@giastfader
giastfader / javascript-example.js
Created December 15, 2015 16:23 — forked from freyr/javascript-example.js
GetResponse APIv2 example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en" />
<meta name="Author" content="Pawel Pabian, Pawel Nejczew http://implix.com" />
<title>Demonstrates how to add new contact to campaign.</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
@giastfader
giastfader / column_placeholder_map.js
Created January 28, 2019 11:14
Using GForm to populate a GDoc Template
//this object maps GSheet column into convenient placeholders used into GDocs templates
var columns_placeholder_map = {
"chronological information" : "date_time",
"Please, insert the company name" : "company_name",
"Company director first name" : "first_name",
"Company director last name" : "last name",
"Price (in $)" : "price"
//...
//...
}
@giastfader
giastfader / machine.js
Created November 11, 2019 17:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions