Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from dbus.mainloop.glib import DBusGMainLoop
import subprocess
import gobject
import dbus
appName = 'Spotify Media Keys'
@tanelpuhu
tanelpuhu / movs.py
Last active December 21, 2015 15:29
#!/usr/bin/env python
# coding=utf-8
import feedparser
import requests
import urlparse
import hashlib
import urllib
import time
import sys
import os
@tanelpuhu
tanelpuhu / just-dice.com.js
Last active December 23, 2015 12:39
~/.js/just-dice.com.js (google "dotjs") with graphs... lil too much right?
/* jquery.sparkline 2.1.2 - http://omnipotent.net/jquery.sparkline/
** Licensed under the New BSD License - see above site for details */
(function(a,b,c){(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.sparkline&&a(jQuery)})(function(d){"use strict";var e={},f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L=0;f=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:c,normalRangeMax:c,normalRangeColor:"#
$('#leftbar').remove();
$('#price').css({
'font-size': '50px',
'height': '60px',
'line-height': '60px'
});
@tanelpuhu
tanelpuhu / arp.sh
Last active August 29, 2015 13:56
phone-is-home
#!/bin/bash
# http://www.reddit.com/r/raspberry_pi/comments/1yrudi/a_simple_bash_script_for_detecting_the_presence/
MACS=`arp -an | awk '{print $4}'`
IFS='\n'
read -a MAC_ARRAY <<< "${MACS}"
for MAC in $MAC_ARRAY
do

Keybase proof

I hereby claim:

  • I am tanelpuhu on github.
  • I am tanel (https://keybase.io/tanel) on keybase.
  • I have a public key whose fingerprint is CCB0 751E 97A6 2998 8140 3FA1 18FD 1DED 30F6 CF4A

To claim this, I am signing this object:

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
#
# Bash completion for fabric
#
function _fab_complete() {
local cur
if [[ -f "fabfile.py" || -d "fabfile" ]]; then
// track in title on play.pocketcasts.com
var doc_title = document.title,
intr = function() {
var title = $('.player_podcast_title:first').text(),
remaining = $('.remaining_time:first').text(),
current = $('.current_time:first').text();
if(title && remaining && current) {
document.title = remaining + ' : ' + title + ' : ' + doc_title;
} else {
document.title = doc_title;