Skip to content

Instantly share code, notes, and snippets.

View jonathanmv's full-sized avatar

Jonathan Morales Vélez jonathanmv

View GitHub Profile

https://www.accenture.com/us-en/services/ai-artificial-intelligence-index#accordion-a201b94849-item-968a740a6d

INPUT

Frequently asked questions

What are examples of AI services? With the post pandemic migration to cloud enabling businesses to do more with their data, both the opportunities and challenges associated with AI have grown more complex. For many organizations (banks, for example) AI is not part of their core competencies—and that’s where AI services can help.

Artificial Intelligence consulting services help businesses identify where AI could make them more efficient, more profitable, or open up new revenue streams, and then help them implement AI through strategies, operating models and change management programs. AI services also support the integration of AI solutions into core business functions and processes. Specific examples include: AI for marketing, helping companies get more out of their marketing spend using data and AI; or AI for processing, helping companies process information o

#include <AFMotor.h>
AF_DCMotor left(3); // This is M3
AF_DCMotor right(4); // This is M4
// Stops both wheels
void stop() {
left.run(RELEASE);
right.run(RELEASE);
}
@jonathanmv
jonathanmv / docker-compose.yml
Created January 9, 2019 19:44
Docker Compose file for Schema Registry UI, Kafka Connect and Kafka Connect UI. Please notice that the host names are fake.
version: '2.1'
# from https://github.com/simplesteph/kafka-stack-docker-compose/blob/master/full-stack.yml
services:
schema-registry-ui:
restart: always
image: landoop/schema-registry-ui:0.9.4
hostname: kafka-schema-registry-ui
ports:
- "8001:8000"
@jonathanmv
jonathanmv / kafka.server.properties
Created October 22, 2018 21:41
Kafka server.properties based on file from the kafka cluster setup udemy course
############################# Server Basics #############################
# The id of the broker. This must be set to a unique integer for each broker.
broker.id=1
# change your.host.name by your machine's IP or hostname
## the name is zookeeper because that's what's registered in route53
advertised.listeners=PLAINTEXT://zookeeper-0.ecs-firecamp.com:9092
# Switch to enable topic deletion or not, default value is false
delete.topic.enable=true
@jonathanmv
jonathanmv / etc_init.d_kafka
Created October 22, 2018 20:43
kafka as a service amazon linux
#!/bin/bash
#/etc/init.d/kafka
#chkconfig: - 99 10
DAEMON_PATH=/home/ec2-user/kafka_2.11-2.0.0/bin
DAEMON_NAME=kafka
# Check that networking is up.
#[ ${NETWORKING} = "no" ] && exit 0
PATH=$PATH:$DAEMON_PATH
@jonathanmv
jonathanmv / deploy-gh-pages.js
Created May 5, 2018 11:26
Deploy your static website to github pages
const ghpages = require('gh-pages')
console.log('Publishing GitHub Pages...')
ghpages.publish('dist', () => console.log('Published.'))
@jonathanmv
jonathanmv / await.js
Created March 16, 2018 06:33
To check if await can be chained to then or catch
const l = console.log.bind(console)
const a = () => new Promise(resolve => setTimeout(() => resolve('done'), 1000))
const b = () => new Promise((_, reject) => setTimeout(() => reject('error'), 1000))
const c = async () => {
(await a()).then(l)
(await b()).catch(l)
}
c().then(() => l(`it can be done!!`))
.catch(({message}) => l(`Sorry dude: ${message}`))
@jonathanmv
jonathanmv / makeVideo.js
Created March 8, 2018 23:47
Generate a video from a medium post
const makeVideo = async (username, postId) => {
const analysis = await mediumHelper.getUserPostAnalysis(username, postId)
const speechPath = await awsHelper.saveSpeechLocally(analysis)
const screenshotPath = await mediumHelper.saveUserPostScreenshotLocally(username, postId)
return mediaHelper.createVideo(screenshotPath, speechPath)
}
@jonathanmv
jonathanmv / mediaHelper.js
Created March 8, 2018 23:41
Take a screenshot of a webpage. Make a video from a single image and single audio
const webshot = require('webshot')
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const screenshot = (url, file) => new Promise((resolve, reject) => {
const screenSize = { width: 1920, height: 1080 }
webshot(url, file, { screenSize }, error => {
if (error) {
return reject(error)
}
@jonathanmv
jonathanmv / saveSpeechLocally.js
Created March 8, 2018 23:11
Save the speech from a text into a mp3 file locally
const saveSpeechLocally = text => getSpeech(text).then(saveSpeech)
const getSpeech = text => {
const Text = cleanText(text)
const OutputFormat = 'mp3'
const VoiceId = 'Kimberly'
const params = { Text, OutputFormat, VoiceId }
return polly.synthesizeSpeechAsync(params)
}