Skip to content

Instantly share code, notes, and snippets.

View ethanwillis's full-sized avatar

Ethan Willis ethanwillis

View GitHub Profile
var uppy = window.Robodog.pick({
providers: [],
waitForEncoding: true,
autoProceed: true,
restrictions: {
maxNumberOfFiles: 1,
maxFileSize: (250*1024*1024),
allowedFileTypes: ['.jpg', '.jpeg', '.png']
},
params: {
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: {
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: {
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: {
// 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 November 12, 2018 21:19
Example of using the request library to upload a file to the Rev API
// 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 July 1, 2017 09:03
tnbear business scraper.
(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);
@ethanwillis
ethanwillis / mongoclientexample.js
Created May 5, 2017 00:54
Mongo Client Example
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 February 16, 2017 00:39
ProtcolsIOAPI getProtocols() example result
{
"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 September 20, 2016 15:48
JSON object for saving state of tab 2 in DC Email editor
{
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."
}