Skip to content

Instantly share code, notes, and snippets.

#! 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
@orinocoz
orinocoz / parking map.ipynb
Last active February 23, 2016 11:45 — forked from manugarri/parking map.ipynb
Where the f*** can I park?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/local/bin/python
import RPi.GPIO as GPIO
class RotaryEncoder:
DIRECTION_CLOCKWISE = 1
DIRECTION_COUNTERCLOCKWISE = 3
prv_seq = 0
@orinocoz
orinocoz / bbcradio.sh
Last active August 29, 2015 14:18 — forked from stengland/bbcradio.sh
#!/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