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 | |
# encoding: utf-8 | |
# Quick conversion to Markdown for Curio list text output (Copy As Plain Text) | |
# Separates notes into subparagraphs, builds headers and lists based on max_headers setting | |
# You can insert a line at the top with "max headers: 5" to override the default setting for that text | |
# Usage: | |
# pbpaste|curio2md.rb > markdown_file.md | |
# Also works as a system service | |
max_headers = 3 |
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 | |
input = STDIN.read | |
input.gsub!(/^\=+\n ?(.*?)\n\=+/,"# \\1") | |
input.gsub!(/^-+\n\d+ (.*?)\n-+/,"## \\1") | |
input.gsub!(/^\d+\.\d+ (.*)/,"### \\1") | |
input.gsub!(/^\d+\.\d+\./,"@") | |
input.gsub!(/^@\d+ /,"- ") | |
input.gsub!(/^@\d+\.\d+ /,"\t- ") |
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
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/queuebit/6118987/raw/SelectBullseye.js?x="+(Math.random());})(); |
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
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://cdn.rawgit.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})(); |
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
--Log Completed Reminders to Day One | |
--by Craig Eley (@craigeley), based on scripts by Samantha Hilton and Nick Morris | |
--This script looks for Reminders that were completed today, then automatically sends them to a single Day One entry using the Day One [CLI Tool](http://dayoneapp.com/tools/). | |
--Schedule it to run at 11:55 every night using Lingon or launchd and forget about it | |
tell application "Reminders" | |
set output to "" | |
set output to output & "# Things done on " & date string of (current date) & linefeed | |
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: Responsive Lazy Load YouTube embed tag for Jekyll | |
# Author: Brett Terpstra <http://brettterpstra.com> | |
# Description: Output a styled element for onClick replacement with responsive layout | |
# | |
# Syntax {% youtube video_id [width height] ["Caption"] %} | |
# | |
# Example: | |
# {% youtube B4g4zTF5lDo 480 360 %} | |
# {% youtube http://youtu.be/2NI27q3xNyI %} |
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 | |
target=$1 | |
filename=`basename $1` | |
image="${TMPDIR}${filename}.png" | |
rsrc="${TMPDIR}icn.rsrc" | |
# Create a thumbnail from the file preview | |
qlmanage -t -s 512 -o ${TMPDIR} $target |
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
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/5834741/raw/grablinks.js?x="+(Math.random());})(); |
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 | |
/usr/local/bin/marked "$@" \ | |
| sed \ | |
-e 's!\[\ \]!<input type="checkbox" onclick="return false" onkeydown="return false">!' \ | |
-e 's!\[[.\-]\]!<input type="checkbox" onclick="return false" onkeydown="return false" indeterminate>!' \ | |
-e 's!\[[√xX]\]!<input type="checkbox" onclick="return false" onkeydown="return false" checked>!' \ | |
| awk '{print;if($0~/indeterminate/)found=1;}END{if(found)print "<script>window.addEventListener(\"load\",function(){var arr=document.querySelectorAll(\"input[type=checkbox][indeterminate]\");for(i in arr)arr[i].indeterminate=true;});</script>"}' | |
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 | |
require 'shellwords' | |
dayonedir = %x{ls ~/Library/Mobile\\ Documents/|grep dayoneapp}.strip | |
full_path = File.expand_path("~/Library/Mobile\ Documents/#{dayonedir}/Documents/Journal_dayone/entries") | |
if File.exists?(full_path) | |
system "echo \"#{Shellwords.escape(full_path)}\"|tr -d '\n'|pbcopy" | |
puts full_path | |
puts "Escaped version of your Day One entries path is in your clipboard." |