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
#!/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
// 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/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
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
#!/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
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
## 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
#!/usr/bin/env ruby | |
# Works with IFTTT recipe https://ifttt.com/recipes/125999 | |
# | |
# Set Hazel to watch the folder you specify in the recipe. | |
# Make sure nvALT is set to store its notes as individual files. | |
# Edit the $target_folder variable below to point to your nvALT | |
# ntoes folder. | |
require 'date' | |
require 'open-uri' | |
require 'net/http' |
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 | |
# encoding: utf-8 | |
# tag primary folders =Tagname | |
# target them with #Tagname | |
# tag subfolders with @nickname | |
# target them with :nickname | |
# if no tagged folder exists but there's a matching folder name, that's used | |
# otherwise it will create folders based on :tags | |
# :tags can be strung together :bt:Drafts:testing for nesting | |
# Only one #Tag and one :path should exist in a file's tags |