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 re | |
import colorsys | |
class ColorFunc(object): | |
MATCH = re.compile('^([a-z]+)\(([^\)]+)') | |
def __init__(self, value): | |
self.func_name, self.func_args = self.MATCH.match(value).groups() | |
self.func_args = [x.strip() for x in filter(lambda x:x, self.func_args.split(','))] |
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 decimal import Decimal | |
def fiveround(x): | |
return Decimal(int(5 * round(float(x)/5))) | |
def simplify(x): | |
result = [] | |
curr_x = x | |
items = map(lambda x:Decimal(x), [45,35,25,10,5,2.5]) |
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 python3 | |
# NOTICE if you use this on a directory, it'll function recursively, back up your files first! | |
import os | |
import sys | |
WORDLIST = [ | |
'addr', | |
'address', | |
'address6', |
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
Instructions for ArchLinux | |
- Place [email protected] in /etc/systemd/system | |
Then for each user: | |
- Create a .sync directory in the user's home directory | |
- Create a config file (eg: /usr/bin/btsync --dump-sample-config > ~/.sync/btsync.json) | |
- Change options: | |
"storage_path" : "/home/<username>/.sync" |
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
net_caloric_avg_fix.patch | |
ProgressReport->valuesUsedToCalculateAverageWeeklyNetCalories() is currently | |
calculated using all DiaryDay->netCalories() values which are >0, this causes incorrect | |
results on days where netCalories < 0 due to exercise. | |
This patch changes the condition to check each DiaryDay->caloriesConsumed() > 0 and | |
then appends DiaryDay->netCalories() to the array for calculating the average weekly net calories. | |
This behavior is consistent with the iPhone version, and reflects the note at the bottom of the |
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 | |
echo "Starting" | |
while [[ $(curl --user-agent "klowner" -s https://play.google.com/store/devices | grep -o "\(Nexus\ 5\)") == '' ]]; do | |
NOW=$(date) | |
echo "Waiting $NOW" | |
sleep 60 | |
done | |
mailsend -to [email protected] -cc [email protected] -from [email protected] -ssl -smtp smtp.gmail.com -port 465 -sub "Nexus 5 ALERT HIGH PRIORITY" \ |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
body { | |
background: #f06; | |
background: linear-gradient(45deg, #f0f, #f02); | |
min-height: 100%; | |
overflow: hidden; | |
height: 100%; | |
} |
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
// Read the Google Services Account pkcs12 key and return the fingerprint. | |
// This is not important for functionality, but will allow the user to | |
// cross-reference their uploaded fingerprint with the one displayed in the | |
// Google credentials management page. | |
function get_google_services_key_fingerprint () { | |
global $google_services_key_path; | |
$certs = array(); | |
openssl_pkcs12_read(file_get_contents($google_services_key_path), $certs, "notasecret"); | |
if (sizeof($certs) > 0) { | |
$output = $certs['cert']; |
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
import time | |
import urllib2 | |
import random | |
from datetime import datetime | |
def do_dave(): | |
while 15 < datetime.now().hour < 18: | |
time.sleep(5) | |
urllib2.urlopen(random.choice(['http://slashdot.org/', 'http://facebook.com/'])) |
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 -*- | |
# | |
# a simple python script for toggline xinput devices via dmenu | |
# Written by Mark "Klowner" Riedesel 2015 | |
# | |
# License: MIT yadda yadda, do what you want | |
import subprocess | |
import re |
OlderNewer