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
#!/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 |
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
$('#leftbar').remove(); | |
$('#price').css({ | |
'font-size': '50px', | |
'height': '60px', | |
'line-height': '60px' | |
}); |
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
/* 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:"# |
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
#!/usr/bin/env python | |
# coding=utf-8 | |
import feedparser | |
import requests | |
import urlparse | |
import hashlib | |
import urllib | |
import time | |
import sys | |
import os |
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
#!/usr/bin/env python | |
from dbus.mainloop.glib import DBusGMainLoop | |
import subprocess | |
import gobject | |
import dbus | |
appName = 'Spotify Media Keys' | |
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
#!/usr/bin/env python | |
# github.com/kasun/YapDi.git | |
import yapdi | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
from BaseHTTPServer import HTTPServer | |
import ssl | |
import sys | |
import os |
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
#!/usr/bin/env python | |
import sys | |
import os | |
if len(sys.argv) < 2: | |
print os.path.basename(sys.argv[0]), 'path' | |
sys.exit() | |
def handle_file(directory, file): | |
fullpath = os.path.join(directory, file) |
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
gsettings set com.canonical.Unity.Panel systray-whitelist "['all']" |
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
def has_falsy(lst): | |
def is_falsy(val): | |
return not val | |
return not not len(filter(is_falsy, lst)) | |
assert not has_falsy([]) | |
assert not has_falsy([1,2,3]) | |
assert not has_falsy(['0']) | |
assert not has_falsy(['None']) | |
assert has_falsy([None]) |
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
def render(view, data = None): | |
current_dir = os.path.dirname(__file__) | |
path = os.path.abspath( | |
os.path.join(current_dir, '..', 'views', '%s.html' % view) | |
) | |
if not os.path.exists(path): | |
return '404 - view not found!' | |
if data is None: | |
data = {} | |
return template.render(path, data) |