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/osascript | |
(* | |
This code is a modified version of `chrome.applescript` found in | |
[googlemusic-hotkeys][1] on github. | |
[chrome.applescript][2] by [Steven La][3], unlicensed | |
[1]: https://github.com/stevenla/googlemusic-hotkeys |
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 logging | |
log = logging.getLogger(__name__) | |
class Stopwatch(object): | |
def __init__(self, wallclock=True): | |
self.timefunc = time.time if wallclock else time.clock |
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 | |
TERM_APP="iTerm" # change to your prefered terminal app | |
here=$(printf '%q' "$(pwd)") # quote it | |
command="$@" | |
osascript -e "$(cat <<EOF | |
on run argv | |
activate application "$TERM_APP" |
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 json | |
import sys | |
from subprocess import Popen | |
from urlparse import urlunsplit | |
def main(): | |
params = json.load(sys.stdin) | |
urlparts = [] |
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 argparse | |
import colorsys | |
HTML_TEMPLATE = """<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { |
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 | |
import argparse | |
import json | |
import sys | |
from textwrap import indent | |
from subprocess import PIPE, Popen | |
class Grid(object): |
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 | |
vols=() | |
maxwidth=0 | |
while read -r vol; do | |
vols+=( "$vol" ) | |
maxwidth=$(echo -e "${maxwidth}\n${#vol}" | sort -n | tail -n1) | |
done < <(mdutil -a 2>&1 | awk -F: '{print $1}') | |
fmt="%-${maxwidth}s %s\n" |