Skip to content

Instantly share code, notes, and snippets.

View chauncey-garrett's full-sized avatar

Chauncey Garrett chauncey-garrett

View GitHub Profile
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
# Updated 2013-10-31 to handle:
# listing all files with tags
# list only files without tags
# and deal with spaces in filenames (that part got ugly).
# Also, set the query variable to local
# List files with specified Finder tags in current directory and subdirectories
# Works with partial words starting from the beginning of the word
lst() {
@chauncey-garrett
chauncey-garrett / test_if_interactive_shell.sh
Created October 25, 2013 20:52
Test for an interactive shell in Bash
if [[ -z $PS1 ]] # no prompt?
### if [ -v PS1 ] # On Bash 4.2+ ...
then # non-interactive
...
else # interactive
...
fi
@chauncey-garrett
chauncey-garrett / pdf_manipulation.tex
Created October 19, 2013 17:57
Use LaTex as a PDF manipulation tool
\documentclass[letter]{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[pages=1-]{/Users/pmccann/Desktop/1.pdf}
\includepdf[pages=4-6]{/Users/pmccann/Desktop/2.pdf}
\includepdf[pages={4-5,10-14}]{/Users/pmccann/Desktop/3.pdf}
\end{document}
<?xml version="1.0"?>
<root>
<item>
<name>F19 to F19</name>
<appendix>(F19 to Hyper (ctrl+shift+cmd+opt) + F19 Only, send escape)</appendix>
<identifier>private.f192f19_escape</identifier>
<autogen>
--KeyOverlaidModifier--
KeyCode::F19,
KeyCode::COMMAND_L,
#!/usr/bin/ruby
# WebExcursions, a script for gathering new Pinboard links with a certain tag
# and generating Markdown/Jekyll posts when enough are collected.
# Brett Terpstra 2013
#
# -f to force writing out current bookmarks to file regardless of count
%w[fileutils set net/https zlib rexml/document time base64 uri cgi stringio].each do |filename|
require filename
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.078821629285812378</real>
<key>Green Component</key>
<real>0.07883714884519577</real>
@chauncey-garrett
chauncey-garrett / fl
Last active December 18, 2015 07:29 — forked from nanoant/fl
#!/bin/bash
#
# Open folder in ForkLift.app from console
# Author: Adam Strzelecki nanoant.com
#
# Usage:
# fl [<folder>]
#
# Opens specified directory or current working directory in ForkLift.app
#