Skip to content

Instantly share code, notes, and snippets.

gem install bundler
git clone git://github.com/arlingtonruby/radbot.git
cd radbot
bundle
#!/usr/bin/python3
#required libraries
import sys
import ssl
import paho.mqtt.client as mqtt
#called while client tries to establish connection with the server
def on_connect(mqttc, obj, flags, rc):
if rc==0:
@redavis22
redavis22 / ce_highlight.js
Created May 18, 2016 22:18 — forked from ebidel/ce_highlight.js
Continuous custom element higlighter
// Continuously higlights the custom elements on the page. This is useful
// if new custom elements are lazy loaded later on or you have a SPA
// that uses other elements.
// CE finding code from: https://gist.github.com/ebidel/4bdbe9db55d8a775d0a4
(function() {
let cache = [];
function highlightCustomElements() {
@redavis22
redavis22 / PrintRevealNotes.js
Created July 25, 2016 19:05 — forked from pgaskin/PrintRevealNotes.js
Prints speaker notes for a reveal.js presentation.
/*
Prints speaker notes for a reveal.js presentation.
To print the notes, run the js function PrintRevealNotes()
You need to disable the pop-up blocker
Copyright 2016 Patrick G
http://geek1011.github.io
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import io
import os
import pprint
import boto3
import cv2
import numpy as np
from PIL import Image, ImageOps
from skimage import img_as_float
from skimage.measure import compare_ssim as ssim
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from collections import defaultdict
import time
import irc.client
import pyaudio
from pymouse import PyMouse
from pykeyboard import PyKeyboard
import win32ui
import boto3
polly = boto3.client('polly', region_name='us-east-1')
@redavis22
redavis22 / polly_demo.py
Created February 5, 2017 05:56 — forked from ranman/polly_demo.py
polly stream
import pyaudio
import boto3
polly = boto3.client('polly')
p = pyaudio.PyAudio()
resp = polly.synthesize_speech(Text="HELLO WORLD!", TextType="text", OutputFormat="pcm", VoiceId="Justin")
stream = p.open(format=p.get_format_from_width(width=2), channels=1, rate=16000, output=True)
stream.write(resp['AudioStream'].read())
stream.stop_stream()
stream.close()