Skip to content

Instantly share code, notes, and snippets.

@sammachin
sammachin / nexmo-jwt
Last active October 3, 2016 14:49
Generate CAPI JWT's from Command Line
#!/usr/bin/python
import sys
import json
import requests
from datetime import datetime
from base64 import urlsafe_b64encode
import os
import calendar
from jose import jwt
@sammachin
sammachin / unicode_sms.py
Created August 26, 2016 13:37
Sending Amharic Characters with Nexmo using Unicode and Python
import nexmo
#Add Your Nemxo Details and Mobile Number here
nexmo_key='XXX'
nexmo_secret='XXX'
to = 'XXX'
client = nexmo.Client(key=nexmo_key, secret=nexmo_secret)
#First test shows the result of not setting Unicode
@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