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 bash | |
# converts all .flac files to .mp3 and copies them to the | |
# OUT directory; copies all .mp3 files to the OUT directory. | |
LAMEOPTS="-V0 --quiet" | |
if [ "$#" -ne 2 ] | |
then | |
echo "usage: $0 MUSIC_DIR OUTPUT_DIR" | |
exit 1 |
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 json | |
import urllib | |
import urllib2 | |
import argparse | |
def translate(target, text): | |
api = "https://www.googleapis.com/language/translate/v2?" | |
api_key = "AIzaSyBgBlJCogk_1Hd_7WaLQgLVbQss0_dvNUc" |
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
<div id="photos"> | |
<?php bp_album_query_pictures('per_page=5'); ?> | |
<?php if ( bp_album_has_pictures() ) : ?> | |
<ul class="thumb"> | |
<?php while ( bp_album_has_pictures() ) : bp_album_the_picture(); ?> | |
<li> | |
<a href="<?php bp_album_picture_middle_url(); ?>" title="<?php bp_album_picture_title(); ?>"> | |
<img src='<?php bp_album_picture_thumb_url() ?>' alt="<?php bp_album_picture_desc(); ?>" /> | |
</a> | |
</li> |
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
This works: | |
flac -dc -- "/home/zdenton/test/The Pretty Things - S F Sorrow [24-96]/08. The Journey.flac" | sox -t wav - -b 16 -t wav - rate 44100 dither | flac --best -T "TITLE=The Journey" -T "ALBUM=S.F. Sorrow" -T "ALBUM=The Pretty Things" -T "TRACKNUMBER=08" -T "GENRE=" -T "DATE=1968-12" -o "/home/zdenton/test/The Pretty Things - S F Sorrow [16-44] (FLAC)/08. The Journey.flac" - 2>&1 | |
This doesn't: | |
flac -dc -- "/home/zdenton/test/The Pretty Things - S F Sorrow [24-96]/12. Old Man Going.flac" | sox -t wav - -b 16 -t wav - rate 44100 dither | flac --best -T "TITLE=Old Man Going" -T "ALBUM=S.F. Sorrow" -T "ALBUM=The Pretty Things" -T "TRACKNUMBER=12" -T "GENRE=" -T "DATE=1968-12" -o "/home/zdenton/test/The Pretty Things - S F Sorrow [16-44] (FLAC)/12. Old Man Going.flac" - 2>&1 | |
The latter stops at around 99% and says: | |
-: WARNING: skipping unknown sub-chunk '��/' (use --keep-foreign-metadata to keep) | |
-: ERROR: unexpected EOF |
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
<?php | |
function bp_album_get_author_userdata() { | |
global $pictures_template; | |
$author_userdata = get_userdata($pictures_template->picture->owner_id); | |
return $author_userdata; | |
} | |
function bp_album_get_the_author() { | |
$author_userdata = bp_album_get_author_userdata(); | |
return $author_userdata->display_name; |
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
from itertools import tee, izip | |
from django.contrib.gis.db import models | |
from django.contrib.gis.measure import Distance | |
from geopy.distance import distance as geopy_distance | |
def pairwise(iterable): | |
"s -> (s0,s1), (s1,s2), (s2, s3), ..." | |
a, b = tee(iterable) |
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
javascript:(function(){var standardGlobals=["top","window","location","external","chrome","document","inlineCSS","target","width","height","canvas","data","DOMURL","img","svg","ctx","url","w","a","speechSynthesis","webkitNotifications","localStorage","sessionStorage","applicationCache","webkitStorageInfo","indexedDB","webkitIndexedDB","crypto","CSS","performance","console","devicePixelRatio","styleMedia","parent","opener","frames","self","defaultstatus","defaultStatus","status","name","length","closed","pageYOffset","pageXOffset","scrollY","scrollX","screenTop","screenLeft","screenY","screenX","innerWidth","innerHeight","outerWidth","outerHeight","offscreenBuffering","frameElement","clientInformation","navigator","toolbar","statusbar","scrollbars","personalbar","menubar","locationbar","history","screen","postMessage","close","blur","focus","ondeviceorientation","ondevicemotion","onunload","onstorage","onresize","onpopstate","onpageshow","onpagehide","ononline","onoffline","onmessage","onhashchange","onbeforeu |