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
## Applications | |
# alias acorn="open -a Acorn" | |
# alias alpha="open -a ImageAlpha" | |
# alias tp="open -a TaskPaper" | |
# alias byword="open -a Byword" | |
# alias xc="open -a Xcode" | |
# | |
## subp is a custom function for finding Sublime projects | |
function _complete_app_alias() |
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
oft() { | |
local target fnd app all | |
target="." | |
fnd='' | |
if [[ $# == 0 ]]; then | |
echo -n "Enter an ext or partial ext: " | |
read ext | |
else | |
[[ "$1" =~ -[h\?] ]] && echo "Usage: oft [-a \"app name\"] [path (fragments)] file extension (fragment)" && return | |
while [[ $# -gt 1 ]]; do |
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 | |
if [[ $1 =~ ((mb)?air|pibble) ]]; then | |
target="pibble.local" | |
else | |
target="macpro.local" | |
fi | |
ping -c 1 $target &> /dev/null |
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
body { | |
counter-reset: chapter; /* create a chapter counter scope */ | |
} | |
h1:before { | |
content: "Chapter " counter(chapter) ". "; | |
counter-increment: chapter; /* add 1 to chapter */ | |
} | |
h1 { | |
counter-reset: subchapter; /* set section to 0 */ | |
} |
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 ruby | |
def package?(file) | |
results = `mdls -name kMDItemContentTypeTree "#{file}" | grep com.apple.package` | |
results.length > 0 | |
end | |
base = ARGV[0] | |
if !base | |
script = File.basename("#{__FILE__}") |
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
// Marker, a bookmarklet for Markdownifying webpage selections | |
// javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading…</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/8078727/raw/Marker.js?x="+(Math.random());})(); | |
(function () { | |
function callback() { | |
(function ($) { | |
var raw, userSelection; | |
if (window.getSelection) { | |
// W3C Ranges | |
userSelection = window.getSelection (); | |
// Get the range: |
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/ruby | |
############################################################################## | |
### getpinboard.rb by Brett Terpstra, 2011 <http://brettterpstra.com> | |
### Retrieves Pinboard.in bookmarks, saves as local .webloc files for | |
### Spotlight searching. | |
### | |
### Optionally adds OpenMeta tags and/or saves page as PDF (see config below) | |
### Use -r [NUMBER OF DAYS] to reset the "last_checked" timestamp (primarily | |
### for debugging). | |
### |
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/ruby | |
$output = "" | |
$max_depth = 3 | |
parent_dir = false | |
if RUBY_VERSION.to_f > 1.9 | |
Encoding.default_external = Encoding::UTF_8 | |
Encoding.default_internal = Encoding::UTF_8 | |
end |
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
tell application "Together 3" | |
set _sel to selected items | |
repeat with _note in _sel | |
set _file to original filename of _note | |
tell application "Marked" to open POSIX path of _file | |
end repeat | |
end tell |
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
# Title: Simple Image tag for Jekyll | |
# Authors: Brandon Mathis http://brandonmathis.com | |
# Felix Schäfer, Frederic Hemberger | |
# Description: Easily output images with optional class names, width, height, title and alt attributes | |
# | |
# Syntax {% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %} | |
# | |
# Examples: | |
# {% img /images/ninja.png Ninja Attack! %} | |
# {% img left half http://site.com/images/ninja.png Ninja Attack! %} |