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
### See PIN-based authorization for details at | |
### https://dev.twitter.com/docs/auth/pin-based-authorization | |
import tweepy | |
consumer_key=<your_app_consumer_key> | |
consumer_secret=<your_app_consumer_secret> | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) |
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
# WARNING: here getArtist() implicitly converts unicode into str... | |
self.tag = player.getMusicInfoTag() | |
artist = self.tag.getArtist() | |
title = self.tag.getTitle() | |
# skip weird cases when music stop (title == '') or is streaming (title == 'Streaming...') | |
if not title or title.lower() == 'streaming...': | |
print 'title = ' + title | |
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
tell application "Safari" to activate | |
tell application "Safari" | |
tell window 1 | |
set current tab to (make new tab with properties {URL:"http://hangout.google.com"}) | |
end tell | |
delay 5 | |
tell application "System Events" | |
-- navigate to "Name this hangout" | |
repeat 10 times | |
keystroke tab |
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
#include <Servo.h> | |
Servo myservo; | |
int servoPin = 9; | |
int switchPin = 2; | |
void setup() | |
{ | |
myservo.attach(servoPin); |
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
[program:myapp] | |
autostart = true | |
autorestart = true | |
command = python /home/pi/myapp.py | |
environment=HOME="/home/pi",USER="pi",SECRET_ID="secret_id",SECRET_KEY="secret_key_avoiding_%_chars" | |
stdout_logfile = /home/pi/stdout.log | |
stderr_logfile = /home/pi/stderr.log | |
startretries = 3 | |
user = pi |
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
// See http://bildr.org/2011/02/74hc595/ | |
int SER_Pin = 11; //pin 14 (Data) on the 75HC595 | |
int RCLK_Pin = 9; //pin 12 (Latch) on the 75HC595 | |
int SRCLK_Pin = 8; //pin 11 (Clock) on the 75HC595 | |
//How many of the shift registers - change this | |
#define number_of_74hc595s 8 |
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
% | |
% Draw random dots within black filled circle | |
% Dots number from 89 to 299 | |
% | |
for n = 89:299 | |
% Draw filled circle | |
f = figure; | |
filledCircle([0,0], 1,1000, 'k'); |
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
%%% Example: | |
%%% | |
%%% Create a 3000Hz triangel wave data for 3 seconds, and | |
%%% play the wave data at 44100Hz (default) sample rate, also | |
%%% save to .wav file. | |
%%% | |
%%% | |
%%% wave = OSCILLATOR('Triangle', 3, 3000); | |
%%% soundsc(wave, 44100); |
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
void loop() | |
{ | |
if ( connected ) | |
{ | |
int packetSize = Udp.parsePacket(); | |
if ( packetSize != 0 ) { | |
Udp.read( data, numPins ); | |
Serial.println( "Data received" ); | |
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
// See http://forum.arduino.cc/index.php?topic=158312.0 | |
// NewLiquidCrystal library | |
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads | |
#include <Wire.h> | |
#include <LCD.h> | |
#include <LiquidCrystal_I2C.h> | |
#define I2C_ADDR 0x27 // Define I2C Address for the PCF8574T |
OlderNewer