I hereby claim:
- I am tupton on github.
- I am tupton (https://keybase.io/tupton) on keybase.
- I have a public key ASBctvCZaghnMCnQ9DRzjMkcNiKXw9ck0pL4WO3Np3dbGAo
To claim this, I am signing this object:
#!/bin/bash | |
# create variables | |
while read L; do | |
k="`echo "$L" | cut -d '=' -f 1`" | |
v="`echo "$L" | cut -d '=' -f 2`" | |
export "$k=$v" | |
done < <(grep -e '^\(title\|artist\|album\|stationName\|pRet\|pRetStr\|wRet\|wRetStr\|songDuration\|songPlayed\|rating\)=' /dev/stdin) # don't overwrite $1... | |
username='<YOUR GOOGLE USERNAME>'; |
curl -X POST \ | |
--data-urlencode "[email protected]" \ | |
--data-urlencode "s=secret" \ | |
--data-urlencode "track=Red Sky" \ | |
--data-urlencode "artist=Thrice" \ | |
--data-urlencode "album=Vheissu" \ | |
--data-urlencode "duration=258" \ | |
http://scrobbular.appspot.com/scrobble |
if (type == 'node-down' || type == 'cluster-balance') { | |
this['thresholdNode'].set('disabled', true); | |
this['comparatorNode'].set('disabled', true); | |
} |
<?php | |
function getObject($id) { | |
$object = null; | |
// TODO Do we need to validate username? | |
$objects = $this->db->retrieveForUsername($this->username); | |
// FIXME Write `retrieveForIdAndUsername` instead of iterating here | |
foreach ($objects as $o) { |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>DataStax OpsCenter Alerts</title> | |
<script src="js/dojotoolkit/dojo/dojo.js"></script> | |
<script> | |
require([ | |
'dojo/_base/lang', | |
'dojo/_base/xhr', |
javascript:(function(e,t){var n=e.document;setTimeout(function(){function a(e){if(e.data==="destroy_bookmarklet"){var r=n.getElementById(t);if(r){n.body.removeChild(r);r=null}}}var t="DELI_bookmarklet_iframe",r=n.getElementById(t);if(r){return}var i="https://delicious.com/save?",s=n.createElement("iframe");s.id=t;s.src=i+"url="+encodeURIComponent(e.location.href)+"&title="+encodeURIComponent(n.title)+"¬e="+encodeURIComponent(""+(e.getSelection?e.getSelection():n.getSelection?n.getSelection():n.selection.createRange().text))+"&v=1.1";s.style.position="fixed";s.style.top="0";s.style.left="0";s.style.height="100%25";s.style.width="100%25";s.style.zIndex="16777270";s.style.border="none";s.style.visibility="hidden";s.onload=function(){this.style.visibility="visible"};n.body.appendChild(s);var o=e.addEventListener?"addEventListener":"attachEvent";var u=o=="attachEvent"?"onmessage":"message";e[o](u,a,false)},1)})(window) |
import datetime | |
import pytz | |
def format_report_date(date_or_nsdate): | |
formatted = None | |
if type(date_or_nsdate) is float: | |
try: | |
reference_date = datetime.datetime(2001, 1, 1, 0, 0, 0, 0, pytz.utc).strftime('%s') | |
formatted = datetime.datetime.fromtimestamp(long(reference_date) + date_or_nsdate) | |
except e: |
# get_tracks is an api method to get recent tracks for a user, with paging and caching | |
# get_track is an api method to get a single track from mbid or artist+name, with caching | |
import itertools | |
from operator import itemgetter | |
def track_to_artist_and_duration(track): | |
api_track = get_track(track) | |
return (track.get('artist').get('name'), track.get('name'), api_track.get('duration')) |
I hereby claim:
To claim this, I am signing this object: