This file contains hidden or 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 os | |
import re | |
from time import gmtime | |
# ref: https://stuvel.eu/flickrapi-doc/ | |
import flickrapi | |
api_key = 'OOOOOOOOOOOOOOOOO' | |
api_secret = 'XXXXXXXXXXXXX' |
This file contains hidden or 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 | |
ffmpeg -y -i "$f" -vn -c:a libfdk_aac -b:a 128k "audio/$(basename $f .mp4).m4a" | |
afconvert -f caff -d opus -b 8000 "audio/$(basename $f .mp4).m4a" "opus/$(basename $f .mp4).caf" |
This file contains hidden or 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 | |
# vim: set sw=4 sts=4 ts=4 et si: | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
import BaseHTTPServer | |
class CORSRequestHandler (SimpleHTTPRequestHandler): | |
def end_headers (self): | |
self.send_header('Access-Control-Allow-Origin', '*') | |
SimpleHTTPRequestHandler.end_headers(self) |
This file contains hidden or 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
{ | |
"faceAnnotations": [ | |
{ | |
"rollAngle": 3.2389677, | |
"panAngle": -9.39832, | |
"tiltAngle": 1.9103807, | |
"detectionConfidence": 0.94434965, | |
"landmarkingConfidence": 0.7591174, | |
"joyLikelihood": "UNLIKELY", | |
"sorrowLikelihood": "VERY_UNLIKELY", |
This file contains hidden or 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 os | |
def get_url_from_node(filename): | |
with open(filename) as fin: | |
for line in fin: | |
if 'refresh' in line: | |
return line[42:-5] | |
#iname = 'www/node/1/index.html' | |
#print get_url_from_node(iname) |
This file contains hidden or 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
Show hidden characters
// Compilation settings | |
// ==================== | |
// | |
// The actual magic happens in the make_pdf command | |
// I stick to the format of standard ST2 sublime-build files | |
// with minor variations. | |
// NOTE: the viewer is NOT configured from here! | |
// As of 5/24/11, it cannot be changed, but I will introduce a setting later | |
{ |
This file contains hidden or 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 | |
mkdir -p html_pages | |
if [ ! -f html_pages/$1.html ]; then | |
echo 'get html page' $1 | |
curl -s http://www.movieposterdb.com/posters/?page=$1 > html_pages/$1.html | |
fi |
This file contains hidden or 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 | |
_invoke() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts=$(invoke -l | tail -n+3 | awk '{ print $1 }' | tr '\n' ' ') |
This file contains hidden or 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 | |
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 14.04 | |
# Copyright @ 2014 Shuen-Huei (Drake) Guan <[email protected]> | |
# References: | |
# * https://gist.github.com/xdamman/e4f713c8cd1a389a5917 | |
# * https://blog.dlasley.net/2013/05/install-ffmpeg-from-source/ | |
# * http://fermat-little-theorem-blog.logdown.com/posts/203069-solved-when-building-gpac-suffer-usr-local-lib-libswscalea-error-adding-symbols-bad-value |
This file contains hidden or 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 -*- | |
# vim: set hls is ai et sw=4 sts=4 ts=8 nu ft=python: | |
# | |
# Copyright © 2014 drake <[email protected]> | |
# | |
# Distributed under terms of the MIT license. | |
# Built-in modules |
NewerOlder