Skip to content

Instantly share code, notes, and snippets.

@fractaledmind
fractaledmind / Create and Autolink to new Evernote Note from Selection
Last active April 21, 2020 12:06
This script takes text selected from within an Evernote note and (1) creates a new note whose titles matches the selected text in the same notebook, (2) embeds a link to the original note as the first line of the new note, and (3) replaces the selected text with a link to the newly created note. This allows you to easily create a wiki-like envir…
@ttscoff
ttscoff / barchart.rb
Last active February 20, 2025 09:49
Command line bar chart from JSON data (for GeekTool, et al)
#!/usr/bin/env ruby
# encoding: utf-8
# Brett Terpstra 2013, WTF license <http://www.wtfpl.net/txt/copying/>
# Outputs a vertical bar chart from date-based JSON data
# Requires the JSON rubygem: `[sudo] gem install json`
require 'date'
require 'open-uri'
require 'rubygems'
require 'json'
@ttscoff
ttscoff / app-alias-completion.sh
Created November 2, 2013 00:37
Command-specific Bash filename completions for application aliases
## 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()
@ttscoff
ttscoff / ifttt-pocket_to_nvalt.rb
Created November 1, 2013 12:05
A Hazel script for converting IFTTT-saved Pocket favorites to nvALT notes
#!/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'
@ttscoff
ttscoff / tagfiler.rb
Last active March 22, 2025 09:34
Moves files to folders based on special tags in OS X Mavericks
#!/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
@fractaledmind
fractaledmind / Skim Page Splitter
Last active May 31, 2019 17:08
This little program uses the Mac app Skim to split scanned PDFs that have two pages layed out on a single PDF page in landscape mode.
(* SPLIT TWO-PAGE PDFS
--Stephen Margheim
-- 11/2/13
-- open source
VERSION 3.0
--Version 3 adds a feature for OCR'd PDFs. If your PDF has been OCR'd, the script now automatically crops the individual pages so that the text field is centered.
This little program uses the Mac app Skim to split scanned PDFs that have two pages layed out on a single PDF page in landscape mode:
@fractaledmind
fractaledmind / Convert customurls to pdfpen urls
Created October 20, 2013 04:46
This script will convert previously created Evernote notes with Skim annotations that had the old "customurl" scheme into my new, iOS friendly "pdfpen" urls.
property tid : AppleScript's text item delimiters
property LF : (ASCII character 32) & (ASCII character 32) & (ASCII character 10)
tell application id "com.evernote.evernote"
set Evernote_Selection to selection
if Evernote_Selection is {} then display dialog "Please select a note."
set noteLink to ""
repeat with i from 1 to the count of Evernote_Selection
set noteName to title of item i of Evernote_Selection
@fractaledmind
fractaledmind / Export Skim Annotations with PDFPen urls
Last active August 31, 2018 05:57
REQUIRED PROGRAMS: - Skim (pdf viewer and annotator) - Evernote (cloud based note app) - works with PDFPen for iPad and iPhone This script will (as the title suggests) export all of you Skim notes directly to Evernote with hyperlinks.
(* EXPORT ALL SKIM NOTES TO EVERNOTE WITH IOS HYPERLINKS
-- Stephen Margheim
-- 10/16/13
-- open source
REQUIRED PROGRAMS:
- Skim (pdf viewer and annotator)
- Evernote (cloud based note app)
- works with PDFPen for iPad and iPhone
@fractaledmind
fractaledmind / EXPORT ALL SKIM NOTES TO EVERNOTE WITH DEVONTHINK HYPERLINKS
Created October 18, 2013 19:05
This script will (as the title suggests) export all of you Skim notes directly to Evernote with hyperlinks to redirect you to the item in your DEVONthink database. REQUIRED PROGRAMS: - Skim (pdf viewer and annotator) - Evernote (cloud based note app) - DEVONthink (database program)
from webbrowser import open
from urllib import quote
query = sys.argv[1]
#Web Services
stackoverflow = '!s '
wikipedia = '!w '
macupdate = '!mac '
appshopper = '!app '