Skip to content

Instantly share code, notes, and snippets.

@cgvarela
cgvarela / alexa_skill_example.php
Created January 11, 2019 11:05 — forked from solariz/alexa_skill_example.php
Amazon Echo / Alexa Intent example in PHP with Security validation
<?php
/* This is a simple PHP example to host your own Amazon Alexa Skill written in PHP.
In my Case it connects to my smarthome Raspberry pi Cat Feeder with two intents;
1: Dispense Food to the cats.
2: When did the Feeder last time feed the cats? Return a spoken time / date
This Script contains neccessary calls and security to give you a easy to use DIY example.
v2016.12.29
Details in my Blogpost: https://solariz.de/de/amazon-echo-alexa-meets-catfeeder.htm
*/
@cgvarela
cgvarela / tweet_listener.py
Created June 14, 2019 11:43 — forked from hugobowne/tweet_listener.py
Here I define a Tweet listener that creates a file called 'tweets.txt', collects streaming tweets as .jsons and writes them to the file 'tweets.txt'; once 100 tweets have been streamed, the listener closes the file and stops listening.
class MyStreamListener(tweepy.StreamListener):
def __init__(self, api=None):
super(MyStreamListener, self).__init__()
self.num_tweets = 0
self.file = open("tweets.txt", "w")
def on_status(self, status):
tweet = status._json
self.file.write( json.dumps(tweet) + '\n' )
self.num_tweets += 1
@cgvarela
cgvarela / Conda.md
Created July 22, 2019 09:39 — forked from misho-kr/Conda.md
Summary of "Conda Essentials" course at DataCamp.Com

Summary

Conda packages are files containing a bundle of resources: usually libraries and executables, but not always. In principle, Conda packages can include data, images, notebooks, or other assets.

One of the powerful aspects of conda, both the tool and the package format, is that dependencies are taken care of. That is, when you install any Conda package, any other packages needed get installed automatically.

A Conda package, then, is a file containing all files needed to make a given program execute correctly on a given system.

@cgvarela
cgvarela / tegra-cam.py
Created November 15, 2019 13:13 — forked from jkjung-avt/tegra-cam.py
Capture and display video from either IP CAM, USB webcam, or the Tegra X2/X1 onboard camera.
# --------------------------------------------------------
# Camera sample code for Tegra X2/X1
#
# This program could capture and display video from
# IP CAM, USB webcam, or the Tegra onboard camera.
# Refer to the following blog post for how to set up
# and run the code:
# https://jkjung-avt.github.io/tx2-camera-with-python/
#
# Written by JK Jung <[email protected]>