Skip to content

Instantly share code, notes, and snippets.

@sammachin
sammachin / main.py
Created August 9, 2016 17:54
Stock price to NCCO
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
import json
import requests
[
{
"action":"talk",
"text":"Welcome to Sams's Conference, Powered By Nexmo Voice API"
},
{
"action":"conversation",
"name":"sams-conf",
"enterSound":"true"
}
[
{
"action": "talk",
"text": "You have now entered Tony's conference. The first participant starts the call"
},
{
"action": "conversation",
"name": "nexmo-tony-call",
"enterSound": "true",
}
[{
"timestamp": "28/07/16 22:35",
"rating": -1
}, {
"timestamp": "28/07/16 22:19",
"rating": 0
}, {
"timestamp": "28/07/16 22:34",
"rating": 0
}, {
{
"test": "test"
}
curl "https://rest.nexmo.com/sms/json?api_key=XXXXXXXX&api_secret=XXXXXXX&to=447700900900&from=Demo&type=unicode&text=Nexmo+can+send+emoji🙌"
@sammachin
sammachin / Add the following to
Created February 9, 2016 10:51
Raspberry Pi Chromium Kiosk/Sinage
# 1900x1200 at 32bit depth, DMT mode
disable_overscan=1
framebuffer_width=1900
framebuffer_height=1200
framebuffer_depth=32
framebuffer_ignore_alpha=1
hdmi_pixel_encoding=1
hdmi_group=2
@sammachin
sammachin / chormeium 48 on RPI
Created February 9, 2016 10:22
chormeium 48 on RPI
wget http://ports.ubuntu.com/pool/universe/c/chromium-browser/chromium-browser-l10n_48.0.2564.82-0ubuntu1.1222_all.deb
wget http://ports.ubuntu.com/pool/universe/c/chromium-browser/chromium-browser_48.0.2564.82-0ubuntu1.1222_armhf.deb
wget http://ports.ubuntu.com/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu1.1222_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_48.0.2564.82-0ubuntu1.1222_armhf.deb
sudo dpkg -i chromium-browser-l10n_48.0.2564.82-0ubuntu1.1222_all.deb chromium-browser_48.0.2564.82-0ubuntu1.1222_armhf.deb
@sammachin
sammachin / gist:35f4598b54b73f51e079
Created January 29, 2016 13:05
CallerID By Google Request
GET /plus/v2whitelisted/people/lookup?includePeople=1&includeGal=1&type=phone&fields=kind,items(id,metadata(objectType,plusPageType,attributions),names,phoneNumbers(value,type,formattedType,canonicalizedForm),addresses(value,type,formattedType),images(url,metadata(container)),urls(value),placeDetails)&includePlaces=1&callType=outgoing&id=%2B441934834343 HTTP/1.1
Authorization: Bearer xxxxxxxxxREDACTEDxxxxxxxxxxxxx
User-Agent: Dalvik/2.1.0 (Linux; U; Android 6.0.1; Nexus 6 Build/MMB29S)
Host: www.googleapis.com
Connection: Keep-Alive
Accept-Encoding: gzip
HTTP/1.1 200 OK
Expires: Fri, 29 Jan 2016 12:47:28 GMT
@sammachin
sammachin / db2s3.py
Created January 27, 2016 10:45
Dropbox to S3 image upload
import dropbox
import tinys3
import tempfile
from string import Template
import random
import string
S3_ACCESS_KEY = ""
S3_SECRET_KEY= ""