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
| <!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
| 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
| 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
| /* | |
| * 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
| // 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
| 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
| class ShiftCipher: | |
| def __init__(self, N = 13): | |
| [...] | |
| def encrypt_message(self, message): | |
| encrypted = "" | |
| #lowercase the message as alphabets are lowercase | |
| message = message.lower() | |
| for letter in message: | |
| if self.original_alphabet.count(letter) > 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
| class ShiftCipher: | |
| [...] | |
| import sys | |
| if __name__ == "__main__": | |
| if len(sys.argv) < 3: | |
| print("Not enough arguments, please provide e/d followed by the message") | |
| N = 13 | |
| cipher = ShiftCipher(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
| 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]) | |
| def encrypt_message(self, message): | |
| encrypted = "" | |
| #lowercase the message as alphabets are lowercase |