This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
xax = np.array([1.7,7.7,18.8,27.2,34.5,37.5,37.8,38.1,36.8,35.7,34.9]) | |
yax = np.array(["0-9","10-19","20-29","30-39","40-49","50-59","60-69","70-79","80-89","90-99","100-109"]) | |
values, base = np.histogram(xax, bins=10) | |
cum = np.cumsum(values) | |
yax_arrange = y_axis = np.arange(1, len(yax) + 1, 1) |
This file contains 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
<head> | |
<!-- | |
Cheerlights for the Web. | |
Created by Charlton Trezevant (2016), MIT License | |
What is Cheerlights? See http://cheerlights.com | |
Live Demo: http://cheerlights.ctis.me | |
--> | |
<title>Cheerlights</title> | |
<script src="https://code.jquery.com/jquery-1.10.2.js"></script> | |
<script src="https://code.jquery.com/color/jquery.color-2.1.2.min.js"></script> |
This file contains 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 time | |
import tikteck # See https://github.com/mjg59/python-tikteck | |
import urllib2 | |
# Bulb connection information - HW address, name and password specific to your bulb. See tikteck repo for additional info. | |
bulb_config = ("00:21:4d:00:00:01", "Smart Light", "password") | |
def updateColor(bulb): | |
try: | |
latest_color = urllib2.urlopen('http://api.thingspeak.com/channels/1417/field/2/last.txt'); |
This file contains 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 CONFIG = { | |
BOT_NAME: ' ', | |
TWITTER_API_KEYS: { | |
consumer_key: ' ', | |
consumer_secret: ' ', | |
access_token: ' ', | |
access_token_secret: ' ', | |
}, | |
IMGUR_CLIENT_ID: ' ', | |
GIPHY_API_KEY: 'dc6zaTOxFJmzC', // Giphy's default public API key, from their wiki |
This file contains 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
// Have Cleverbot.io talk to itself | |
// Generally somewhat entertaining, see https://gist.github.com/ctrezevant/119a92c430a7a61134505995461abf66 for an | |
// example transcript. | |
// Charlton Trezevant - 2016 - Unlicense | |
var BOT1 = { | |
CLEVERBOTIO_API_USER: ' ', | |
CLEVERBOTIO_API_KEY: ' ', | |
CLEVERBOTIO_NICK: 'none', | |
}; |
This file contains 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 request = require('request'); | |
var IMGUR_API_KEY = '<your key here>'; | |
exports.fetchImage = function fetchImage(req, res) { | |
if (req.path === undefined || req.path.length <= 1) { | |
res.status(400).send('{"error":"No Data"}'); | |
return; | |
} |
This file contains 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
// moved to https://github.com/ctrezevant/speedRacer ! |
This file contains 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 request = require('request'); | |
var IMGUR_API_KEY = ' '; | |
var PROXY_URL = 'us-central1-[...].cloudfunctions.net'; | |
exports.album = function album (req, res) { | |
if (req.path === undefined || req.path.length <= 1) { | |
res.status(400).send('{"error":"No Data"}'); | |
return; | |
} |
This file contains 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
#pragma config(Sensor, in1, POT, sensorPotentiometer) | |
#pragma config(Motor, port1, MOTOR1, tmotorVex269_HBridge, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
const static int TOLERANCE = 1; // Leeway for pointing to letter | |
const static int MOTOR_SPEED = 32; // Speed at which to move motor | |
const static int WAIT_TIME_SEC = 2; // Number of seconds to wait on each letter | |
// Function should return degree value of position of letters on the dial. | |
// (Forgive me, for I know not of how to implement a proper lookup table in C) |
This file contains 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
/* Documentation: | |
* Assuming an Arduino Mega with the Adafruit Motor Shield and a | |
* stepper motor with a 1.8deg resolution connected to M1 and M2 | |
* Your IDE should have the AFMotor library installed before compilation. | |
* This software manages the movement of a dial connected to a stepper motor, | |
* for use in the demonstration of a caesar cipher (see https://en.wikipedia.org/wiki/Caesar_cipher) | |
* How movement is calculated: | |
* Steps per revolution: (360/motorResolution) + optional stepOffset | |
* Steps to move: (stepsPerRevolution/dialSections) * shiftAmount | |
* Examples: |