This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
playlist = "XXXXXXX" #Playlist ID from URL eg https://www.youtube.com/playlist?list=PL1Hr6VkuONaE4XM52ThiV-s3vXAUT0JCR | |
key = "XXXXXXXX" # Your YouTube API Key from https://console.developers.google.com/apis/credentials | |
params = {"part" : "snippet", "maxResults" : 50, "playlistId": playlist, "key" : key} | |
url = "https://www.googleapis.com/youtube/v3/playlistItems" | |
items = [] | |
r = requests.get(url, params=params) | |
rdata=r.json() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install express | |
npm install body-parser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install nexmo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install ‘flask>=1.0’ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var handlers = { | |
'LaunchRequest': function () { | |
this.emit('SayHello'); | |
}, | |
'SayHello': function(){ | |
if (this.event.user.hasOwnProperty('accessToken')) { | |
this.response.speak('Hello User'); | |
this.emit(':responseReady'); | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var handlers = { | |
'LaunchRequest': function () { | |
this.emit('SayHello'); | |
}, | |
'SayHello': function(){ | |
if (this.event.user.hasOwnProperty('accessToken')) { | |
this.response.speak('Hello User'); | |
this.emit(':responseReady'); | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Downsample frames from 16Khz to 8Khz | |
function convert(message){ | |
var arr = [] | |
var x = 0; | |
var y; | |
var i; | |
for (i = 0; i < 160; i++) { | |
y = x+2 | |
arr.push(message.slice(x,y)) | |
x += 4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sams-iMac:~ smachin$ openssl s_client -connect raw.githubusercontent.com:443 | |
CONNECTED(00000003) | |
depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA | |
verify error:num=20:unable to get local issuer certificate | |
verify return:0 | |
--- | |
Certificate chain | |
0 s:/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=www.github.com | |
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA | |
1 s:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ptt_btn.onmousedown = function(e){ | |
ptt=true; | |
document.getElementById("tx").innerHTML=status_tx; | |
if(ws.readyState == ws.OPEN) { | |
var evt = '{"event": "ptt_on"}'; | |
ws.send(JSON.stringify(evt)); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
register = template.Library() | |
OFFSET = ord('🇦') - ord('A') | |
@register.filter | |
def flag(code): | |
return chr(ord(code[0]) + OFFSET) + chr(ord(code[1]) + OFFSET) | |
# Example: | |
# flag("US") = "🇺🇸" |