Visit my blog or connect with me on Twitter
git init
or
Visit my blog or connect with me on Twitter
git init
or
| #! env ruby | |
| loop do | |
| begin | |
| ping = `ping -n -c 1 -W 3 google.in 2>&1` | |
| rescue | |
| puts "Failed ping" | |
| sleep 1 | |
| next | 
| # see also: http://code.activestate.com/recipes/578150-sending-non-ascii-emails-from-python-3/ | |
| import os | |
| import smtplib | |
| from email.utils import formataddr | |
| from email.utils import formatdate | |
| from email.utils import COMMASPACE | |
| from email.header import Header | 
| #!/usr/local/bin/python | |
| import RPi.GPIO as GPIO | |
| class RotaryEncoder: | |
| DIRECTION_CLOCKWISE = 1 | |
| DIRECTION_COUNTERCLOCKWISE = 3 | |
| prv_seq = 0 | 
| #!/bin/bash | |
| play() { | |
| if [[ $1 == radio3 ]]; then | |
| playlist="http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls" | |
| else | |
| playlist="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p" | |
| fi | |
| echo $playlist | |
| if mpc | |
| then |