Skip to content

Instantly share code, notes, and snippets.

View gist:390c48fc130e78d0e4e162821e1b5aae
const revOrder = function(location) {
var options = {
method: 'POST',
url: 'https://api-sandbox.rev.com/api/v1/orders',
json: true,
headers: {
Authorization: auth_header,
'Content-Type': 'application/json'
},
body: {
View gist:caf1e46d3ca0e4a7fdc61b88a19bec8c
const revOrder = function(location) {
var options = {
method: 'POST',
url: 'https://api-sandbox.rev.com/api/v1/orders',
json: true,
headers: {
Authorization: auth_header,
'Content-Type': 'application/json'
},
body: {
View gist:dc979d3d5496f9a00e5470178039550b
const revOrder = function(location) {
var options = {
method: 'POST',
url: 'https://api-sandbox.rev.com/api/v1/orders',
json: true,
headers: {
Authorization: auth_header,
'Content-Type': 'application/json'
},
body: {
View post-binary-rev_1.js
// Imports
var request = require("request");
var fs = require('fs');
var path = require("path");
var mime = require('mime-types');
let filepath = "/home/ethan/Downloads/sample_iTunes.mov"
let filename = path.basename(filepath);
let client_api_key = ""
let client_user_key = ""
@ethanwillis
ethanwillis / post-binary-rev.js
Created Nov 12, 2018
Example of using the request library to upload a file to the Rev API
View post-binary-rev.js
// Imports
var request = require("request");
var fs = require('fs');
var path = require("path");
var mime = require('mime-types');
let filepath = "/home/ethan/documents/myfile.mp4"
let filename = path.basename(filepath);
let client_api_key = "1234"
let client_user_key = "5678"
@ethanwillis
ethanwillis / tnbear_scrape.js
Created Jul 1, 2017
tnbear business scraper.
View tnbear_scrape.js
(function() {
// Load in a modern version of JQuery from Google CDN.
var script = document.createElement("SCRIPT");
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js';
script.type = 'text/javascript';
script.onload = function() {
var $ = window.jQuery;
};
document.getElementsByTagName("head")[0].appendChild(script);
View mongoclientexample.js
var MongoClient = require('mongodb').MongoClient;
var mongo_url = "mongodb://localhost:27017/mydbname"
MongoClient.connect(settings.application_settings.mongo_url, function(err, db_client) {
var mongo_collection = db_client.collection("a_collection_name");
// Insert empty object { } or whatever you want
mongo_collection.insert({ }, function(err, result) {
// handle err and result
})
@ethanwillis
ethanwillis / get_protocols_result.json
Created Feb 16, 2017
ProtcolsIOAPI getProtocols() example result
View get_protocols_result.json
{
"request": "OK",
"protocols": [{
"protocol_name": "Transformation of Skeletonema marinoi using Multipulse Electroporation",
"protocol_id": "5038",
"version_class": "5038",
"activity": "1486591925",
"is_owner": "0"
}, {
"protocol_name": "Modeling ecological drivers in marine viral communities using comparative metagenomics and network analyses",
@ethanwillis
ethanwillis / tab_2_state.json
Created Sep 20, 2016
JSON object for saving state of tab 2 in DC Email editor
View tab_2_state.json
{
selected_outcome_name: "Insurance Concerns",
selected_outcome_id: "id of selected outcome",
slice_name: "{SelectedOutcome}Slice.X"
template_id: "id of selected template",
template_html: "html + text of template that was edited in the live preview pane. This will include all user text changes."
}
View React Style Example 1
// Template for display data JSON object
template(name="channels")
with data
if params.error
+channels_error
.row
.col.s12
| Channels Forms Goes Here
template(name="channels_error")
You can’t perform that action at this time.