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 os | |
for subdir, dirs, files in os.walk('./muzak'): | |
for file in files: | |
if file.endswith('.mp3'): | |
os.system('open ".%s/%s"' % (subdir[1:], file)) |
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
(defn export-twitter-archive [] | |
(->> (for [f (.listFiles (io/file "tweets/data/js/tweets")) | |
:when (.endsWith (.getName f) ".js")] | |
(for [tweet (json/read-str (second (str/split (slurp f) #"=" 2)) :key-fn keyword)] | |
(assoc tweet | |
:date (java.util.Date. (:created_at tweet))))) | |
(apply concat) | |
(sort-by :date) | |
reverse)) |
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
~/projects/mcav $ cat /etc/hosts | 9:51PM Sat 16 | |
## | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
255.255.255.255 broadcasthost | |
::1 localhost |
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
(defn page-template [config post] | |
(list | |
"<!doctype html>" | |
[:html | |
[:head | |
[:meta {:charset "utf-8"}] | |
[:meta {:name "viewport" :content "width=680"}] | |
[:title (h (str (:title config) (when (:title post) | |
(str ": " (:title post)))))] |
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
(defmacro defapi [method metadata args & forms] | |
`(defn ~method [& {:as named-params#}] | |
;; preprocess arguments | |
(doseq [arg# '~args] | |
(let [param# (get named-params# (keyword arg#)) | |
optional# (:optional (meta arg#))] | |
;; ensure all required arguments were provided | |
(when (and (not optional#) (nil? param#)) | |
(throw (IllegalArgumentException. | |
(format "Argument \"%s\" is required and was not provided." (name arg#))))) |
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
brew install jpeg | |
find . -type f -name '*.jpg' -exec jpegtran -progressive -outfile {} {} \; |
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
root@android:/ # dmesg | |
<6>[ 0.000000] Booting Linux on physical CPU 0 | |
<6>[ 0.000000] Initializing cgroup subsys cpu | |
<5>[ 0.000000] Linux version 3.0.21-perf-g5d8e666-00002-gf46e44c (android-bld@aclgcl-ubnt) (gcc version 4.4.3 (GCC) ) #1 SMP PREEMPT Fri May 17 17:37:08 CST 2013 | |
<4>[ 0.000000] CPU: ARMv7 Processor [410fc051] revision 1 (ARMv7), cr=10c5387d | |
<4>[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache | |
<4>[ 0.000000] Machine: QCT MSM7x27a FFA | |
<6>[ 0.000000] Partition (from atag) boot -- Offset:28f Size:30 | |
<6>[ 0.000000] Partition (from atag) system -- Offset:2bf Size:5a0 | |
<6>[ 0.000000] Partition (from atag) cache -- Offset:85f Size:140 |
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
(ns easytags.core | |
(:require [clojure.string :as str])) | |
(def fs (js/require "fs")) | |
(def format (.-format (js/require "util"))) | |
(set! *print-fn* #(.log js/console)) | |
(defn strip-regex [re] | |
(when re |
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
(defun exec-last-iterm-command () | |
(interactive) | |
(do-applescript | |
(concat | |
"set currentApp to (path to frontmost application as text)\r" | |
"tell application \"iTerm\" to activate\r" | |
"tell application \"System Events\"\r" | |
" delay 0.1\r" | |
" keystroke \"p\" using control down\r" | |
" keystroke return\r" |
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
<!-- | |
Install with: | |
mkdir -p ~/Library/LaunchAgents | |
curl -o ~/Library/LaunchAgents/com.mcav.arbpl.plist https://gist.github.com/mcav/7879144/raw | |
launchctl load -w ~/Library/LaunchAgents/com.mcav.arbpl.plist | |
To stop: | |
launchctl unload ~/Library/LaunchAgents/com.mcav.arbpl.plist |
OlderNewer