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 bash | |
if [[ ! -z "$DEBUG" ]]; then | |
set -x; set -v; | |
fi | |
## | |
# Argument processing | |
if [[ "$#" == "0" ]]; then | |
echo "I can download manga, but I can't read your mind." |
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
# {{{ Android phone sync (PS) and backup | |
PS_BACKUP_DIR=~/Android/Backup # Where to keep backups | |
PS_BACKUP_KEEP=60 # Days to keep backups | |
PS_BACKUP_ENCRYPT_TO="0x00000000" # GPG key ID to sign and encrypt to | |
PS_IP="192.168.0.100" # The IP your device will be found at | |
PS_SSH="Nexus" # The SSH host of your phone, or an SSH alias | |
PS_STAGING=~/Android/Sync # The staging folder for sync, sans trailing slash | |
PS_SDCARD=/sdcard # The sync root on the phone, sans trailing slash | |
PS_RSYNC_OPT="-vzuLr --no-perms" # Extra options to pass to rsync |
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 zsh | |
# Takes all my playlists from ~/.mpd/playlists, fixes them up, and creates a | |
# folder for each, along with the music they reference. | |
# The sync stage requires an sshd server to run on your phone, as well as the rsync executable. | |
# - http://linux.wxs.ro/2011/08/05/rsync-your-android/ | |
MPD_MUSIC_ROOT="${HOME}/Music" # Root of your MPD library | |
MPD_PLAYLIST_ROOT="${HOME}/.mpd/playlists" # MPD playlist folder |
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
function slugify() { | |
[[ -z "$1" ]] && return 65; | |
s=`echo $1 | sed -e 's/\s\{1,\}/ /g' | sed 's/^[ \t]*//;s/[ \t]*$//g' | sed 's/ /-/g' | tr '[A-Z]' '[a-z]'`; | |
debug "1: $s"; | |
typeset -A accents; # key value key value... | |
accents=( 'á' 'a' 'à' 'a' 'â' 'a' 'ä' 'a' 'ã' 'a' | |
'é' 'e' 'è' 'e' 'ê' 'e' 'ë' 'e' | |
'í' 'i' 'ì' 'i' 'î' 'i' 'ï' 'i' | |
'ó' 'o' 'ò' 'o' 'ô' 'o' 'ö' 'o' 'õ' 'o' |
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/zsh | |
BLOG_PATH=${HOME}/dev/blog; | |
DRAFTS_PATH=${BLOG_PATH}/_drafts; | |
POSTS_PATH=${BLOG_PATH}/_posts; | |
FILE_EXT=".mkd" | |
# "be" is a shell alias for "bundle execute". Replace for your way to get jekyll serving. | |
JEKYLL_EX="cd ${BLOG_PATH} && be jekyll"; | |
JEKYLL_SERVE="${JEKYLL_EX} --auto --server 8080 && ${BROWSER} http://localhost:8080"; |
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
# coding: utf-8 | |
require 'net/http' | |
require 'json' | |
require 'cgi' | |
require 'extlib' | |
playing = `mpc current`.chomp | |
key = "insert your API key here" | |
url = "http://tinysong.com/b/#{CGI.escape(playing)}?format=json&key=#{key}" |
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
def test | |
puts "foo" | |
end |
NewerOlder