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
| # Author: Andrew Fisher | |
| # Version: 0.1 | |
| # Date: 30/05/2012 | |
| # Licence: BSD | |
| # This python converts an rgb value expressed in 8 bit values (eg 255, 128, 0) and returns a hex value that | |
| # has been converted to 565 format. This was highly useful when I was playing with some Arduino | |
| # stuff requiring 16 bit LCD designs and couldn't remember the hex layout. | |
| def rgb_hex565(red, green, blue): |
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
| /* | |
| * Oscilloscope | |
| * Gives a visual rendering of analog pin 0 in realtime. | |
| * | |
| * This project is part of Accrochages | |
| * See http://accrochages.drone.ws | |
| * | |
| * (c) 2008 Sofian Audry (info@sofianaudry.com) | |
| * | |
| * This program is free software: you can redistribute it and/or modify |
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
| int pingPin = 13; | |
| int inPin = 12; | |
| void setup() { | |
| Serial.begin(9600); | |
| } | |
| void loop() | |
| { | |
| // establish variables for duration of the ping, |
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
| # Tkinter and GPIO together | |
| from Tkinter import * | |
| import RPi.GPIO as GPIO | |
| GPIO.setmode(GPIO.BCM) | |
| GPIO.setup(24, GPIO.OUT) | |
| GPIO.output(24, GPIO.LOW) | |
| def toggle(): |
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
| <html> | |
| <head> | |
| <script> | |
| // Check for the various File API support. | |
| if (window.File && window.FileReader && window.FileList && window.Blob) { | |
| // Great success! All the File APIs are supported. | |
| } 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 OAuth2 = require('OAuth').OAuth2; | |
| var https = require('https'); | |
| var oauth2 = new OAuth2(KEY, SECRET, 'https://api.twitter.com/', null, 'oauth2/token', null); | |
| oauth2.getOAuthAccessToken('', { | |
| 'grant_type': 'client_credentials' | |
| }, function (e, access_token) { | |
| console.log(access_token); //string that we can use to authenticate request | |
| var options = { |
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
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <div style="text-align:center" onmouseover="Play()" onmouseout="Pause()"> | |
| <video id="video1" width="480"> | |
| <source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4" /> | |
| <source src="http://clips.vorwaerts-gmbh.de/VfE_html5.ogg" type="video/ogg" /> | |
| Your browser does not support HTML5 video. | |
| </video> |
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
| function Node() { | |
| this.left = undefined; | |
| this.right = undefined; | |
| this.person = undefined; | |
| }; | |
| function makeWinners(people, size) { | |
| var root = new Node(); | |
| if(people.length === 1 && (size === 1 || size === 2)) { |
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
| <?php | |
| /* | |
| Name - templated.php | |
| Author - Shafiq Mustapa ([email protected]) | |
| Usage - php templated.php | |
| Stumble this upon site (http://templated.co)that offer over 800+ HTML5 + CSS + Responsive. | |
| This php script will download the file automatically. For now, the page is now 7. | |
| Tools |
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
| /* | |
| print_time() returns a string in the format mm-dd-yyyy hh:mm:ss | |
| */ | |
| #include "RTClib.h" | |
| #include <SD.h> | |
| #include <SPI.h> | |
| RTC_DS1307 rtc; | |
| const int chipSelect = 10; |
OlderNewer