Skip to content

Instantly share code, notes, and snippets.

View dzeitman's full-sized avatar

Dan Zeitman dzeitman

View GitHub Profile
@dzeitman
dzeitman / client.js
Last active November 4, 2021 16:24
Dolby.io-CascadiaJs Workshop - Fiddle Demo
/** Create a list of Cities for our Money Heist Characters */
const cities = ['Seattle', 'Vancouver', 'Portland', 'Tokyo', 'Berlin', 'Palermo', 'Nairobi', 'Denver', 'Helsinki', 'Rio', 'Moscow', 'Oslo'];
let randomName = cities[Math.floor(Math.random() * cities.length)];
// We'll pulls some images that have been named after cities... {Money Heist} and replace our city name in URL and add some cloudinary transformations.
let imagePlaceholder = `https://res.cloudinary.com/dolby-io/image/upload/e_art:red_rock/ar_1:1,c_fill,g_auto,r_max,w_50/v1634690310/dolby-hackathon/cities/${randomName}.png`
/** Update varibles when form input changes */
function updateNameValue(e) {
@dzeitman
dzeitman / client.js
Last active August 30, 2021 01:41
Public: Dolby.io Getting Started with Electron
const avengersNames = ['Thor', 'Cap', 'Tony Stark', 'Black Panther', 'Black Widow', 'Hulk', 'Spider-Man'];
let randomName = avengersNames[Math.floor(Math.random() * avengersNames.length)]
var config = function (){
return JSON.parse(decodeURIComponent(document.location.search.split('=')[1]))
}()
@dzeitman
dzeitman / client.js
Created August 30, 2021 01:24
Dolby.io Getting Started with Electron
const avengersNames = ['Thor', 'Cap', 'Tony Stark', 'Black Panther', 'Black Widow', 'Hulk', 'Spider-Man'];
let randomName = avengersNames[Math.floor(Math.random() * avengersNames.length)]
var config = function (){
return JSON.parse(decodeURIComponent(document.location.search.split('=')[1]))
}()
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
namespace Bose.Wearable
{
public enum Movement{
jump, duck
}
const cloudinary = require('cloudinary');
const express = require('express');
const Webtask = require('webtask-tools');
const bodyParser = require('body-parser');
const request = require('request');
const JSONP = require('node-jsonp');
var Algorithmia = require('algorithmia');
@dzeitman
dzeitman / Example Results
Last active May 7, 2018 19:15
Cloudinary Video upload with Caterorization and VTT creation options example
{
"public_id": "cloudinary-video-promo",
"version": 1525707742,
"signature": "7b87e2472042e8565e51c212d5c37be05498c96f",
"width": 1920,
"height": 1080,
"format": "mp4",
"resource_type": "video",
"created_at": "2018-05-07T15:42:22Z",
"tags": [],
@dzeitman
dzeitman / crop-all-faces.js
Last active April 22, 2018 03:27
fetch image with multiple faces and return cropped faces array;
/**
1> Create a webtask.
2> Add NPM Module for Cloudinary
3> Add secrets for your cloud, api_key and api_secret
*/
var cloudinary = require("cloudinary");
var namor = require('namor');
/**
1> Create a webtask.
2> Add NPM Module for Cloudinary
3> Add secrets for your cloud, api_key and api_secret
*/
var cloudinary = require("cloudinary");
function autoTagByID(context, cb){

Cloudinary's API's provide some great capibilities such as auto tagging.
Sometimes developers want to expand on that by calling other Third Party APIS such as IBM Watson.

In this example we'll take an asset previously uploaded to cloudinary and use IBM Watson services to classify the image to find out what's in the image and then combine the image metadata into a JSON payload, and save that payload back to Cloudinary as a Static JSON resource.

This simple pattern allows for caching the meta data within a static file.
This scenerio might be used versus calling Watson API's each time you want to retrieve the additional meta data.

'use strict';
module.exports = (context, cb) => {
console.log(context);
// post we'll use context.body
if(context.body.token != context.secrets.app_token){
const msg = 'Not authorized to use this service outside of our company slack channel';
cb(null,msg);
}else{