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
| class ShiftCipher: | |
| def __init__(self, N = 13): | |
| self.original_alphabet = ["a","b","c","d","e","f","g","h","i","j","k","l","m", | |
| "n","o","p","q","r","s","t","u","v","w","x","y","z"] | |
| self.cipher_alphabet = self.original_alphabet[N:] | |
| self.cipher_alphabet.extend(self.original_alphabet[0:N]) | |
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
| // NeoPixel Ring simple sketch (c) 2013 Shae Erisson | |
| // released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library | |
| #include <Adafruit_NeoPixel.h> | |
| #ifdef __AVR__ | |
| #include <avr/power.h> | |
| #endif | |
| // Which pin on the Arduino is connected to the NeoPixels? | |
| // On a Trinket or Gemma we suggest changing this to 1 |
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
| /* | |
| * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"). | |
| * You may not use this file except in compliance with the License. | |
| * A copy of the License is located at | |
| * | |
| * http://aws.amazon.com/apache2.0 | |
| * | |
| * or in the "license" file accompanying this file. This file is distributed |
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
| omxplayer -b haunted.mp4& | |
| python3.4 flicker.py 45 |
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 qhue import Bridge | |
| import time | |
| import random | |
| import sys | |
| bridge_ip = "<hue_ip_address>" | |
| username = "<username>" | |
| my_lights = [light_id_1, light_id_2] | |
| def flicker(bridge, elapsed_time, lights_list = [], transition = 10): |
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
| <!DOCTYPE html> | |
| <head> | |
| <title>{{ title }}</title> | |
| </head> | |
| <body> | |
| <h1>PLANT HELPLINE</h1> | |
| <h2>The date and time on the server is: {{ time }}</h2> | |
| <h2> {{ text }} </h2> | |
| <a href="/auto/water/ON"><button>Turn ON Auto Watering</button></a> |
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 water | |
| if __name__ == "__main__": | |
| water.auto_water() |
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
| # External module imp | |
| import RPi.GPIO as GPIO | |
| import datetime | |
| import time | |
| init = False | |
| GPIO.setmode(GPIO.BOARD) # Broadcom pin-numbering scheme | |
| def get_last_watered(): |
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 matplotlib.pyplot as plt | |
| from matplotlib import rcParams | |
| def plot_album_ngrams(albums, artist): | |
| pos = list(range(len(albums))) | |
| width = 0.25 | |
| rcParams.update({'figure.autolayout': True}) | |
| fig, ax = plt.subplots(figsize=(12,6)) |
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
| client_id = 'Your Genius Client ID' | |
| client_secret = 'Your Genius Client Secret' | |
| client_access_token = 'Your Genius Access Token' | |
| import plot_albums | |
| import string | |
| import requests | |
| import nltk | |
| from sys import argv | |
| from bs4 import BeautifulSoup |