Step 0: Open Automator, New Service.
Step 1: Drag out Run Shell Script action. Pass Input to STDIN
Step 2: This code:
open `gist`
| *.acn | |
| *.acr | |
| *.alg | |
| *.aux | |
| *.bak | |
| *.bbl | |
| *.bcf | |
| *.blg | |
| *.brf | |
| *.bst |
| #!/bin/bash | |
| if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
| appify v3.0.1 for Mac OS X - http://mths.be/appify | |
| Creates the simplest possible Mac app from a shell script. | |
| Appify takes a shell script as its first argument: | |
| `basename "$0"` my-script.sh |
| #!/usr/bin/env python | |
| """ | |
| PIP can stand for PIP Installs packages Programmatically, too! | |
| (and here's how) | |
| Requires: | |
| * Python 2.6 or higher (for print-as-a-function) | |
| * PIP 0.8.2 | |
| """ |
| # Neo.Lo | |
| # 2011-04-15 12:38:10 PM | |
| tell application "TextWrangler" | |
| set author to "Neo.Lo" | |
| set website to "http://studio.zeuik.com/" | |
| set wrap to 80 | |
| set out to {} | |
| set end of out to " * Name : " & name of document 1 |
| #!/bin/sh | |
| echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
| read inputline | |
| name="$inputline" | |
| echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
| read inputline | |
| url="$inputline" |
| /* | |
| This is my hacked up copy of Marked.app/Contents/Resources/gridless.css | |
| Changes: | |
| 1. Smaller headings | |
| 2. ~~No scrollbars~~ (I now prefer the Lion default behavior) | |
| 3. Styling of definition lists ala LaTeX description lists. | |
| 4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block). | |
| $(".TS-year_notch_year_text").each(function(){ | |
| var el = $(this); | |
| var text = el.text(); | |
| text = text.replace(/(\d?\d:\d\d) ((a\.m\.|p\.m\.))/, function(date, time, ampm){ | |
| var hourMinute = _.map(time.split(":"), function(it){ return parseInt(it, 10); }); | |
| if(ampm === "p.m.") { | |
| hourMinute[0] = hourMinute[0] + 12; | |
| } else if(ampm === "a.m." && hourMinute[0] === 12) hourMinute[0] = 0; | |
| return hourMinute.join("."); | |
| }); |
| -- | |
| -- OCR all documents added to a folder | |
| -- | |
| on adding folder items to this_folder after receiving added_items | |
| try | |
| repeat with i from 1 to number of items in added_items | |
| set this_item to item i of added_items | |
| set appName to my getAppName() | |
| tell application appName | |
| activate |
| require 'rubygems' | |
| require 'matrix' | |
| require 'lingua/stemmer' | |
| require 'csv' | |
| require 'erb' | |
| require 'iconv' | |
| require 'sanitize' | |
| require './cleaner.rb' | |
| STEMMER = Lingua::Stemmer.new |