Skip to content

Instantly share code, notes, and snippets.

@macdrifter
macdrifter / PDFMerge.scpt
Created March 2, 2010 03:20
AppleScript that calls the python code buried in an automator action. This is example code for use with Devonthink Office Pro. The script should combine to PDF's into one new original
(* AppleScript that calls the python code buried in an automator action. This is example code for use with Devonthink Office Pro. The script should combine to PDF's into one new original *)
try
set myScript to "/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -- Path to the python script
set sourceOne to "/Path/To/First/PDF/myFile.PDF" -- First PDF
set sourceTwo to "/Path/To/Second/PDF/myFile.PDF" -- Second PDF
set myDestination to "~/final.pdf" -- The new file
@macdrifter
macdrifter / hack.sh
Created May 4, 2012 01:49
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@macdrifter
macdrifter / gist:3066526
Created July 7, 2012 13:45 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@macdrifter
macdrifter / gist:3066528
Created July 7, 2012 13:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@macdrifter
macdrifter / rss-subscribers.sh
Created September 26, 2012 00:38
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default).
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic.
# Required variables:
RSS_URI="/rss"
MAIL_TO="[email protected]"
LOG_FILE="/var/log/httpd/access_log"
@macdrifter
macdrifter / imageUpload.py
Created October 14, 2012 03:05
imageUpload
import Image, ImageOps, ImageFilter
import ftplib
import console
import clipboard
import datetime
from io import BytesIO
today = datetime.datetime.now()
image = clipboard.get_image()
@macdrifter
macdrifter / pinbook.js
Created October 15, 2012 00:51 — forked from ChewingPencils/pinbook.js
Pinbook Bookmarklet
javascript:window.location='pinbook:///add?url='%20+%20encodeURIComponent(document.location.href)%20+%20'&title='%20+%20encodeURIComponent(document.title);
@macdrifter
macdrifter / get_links.py
Created October 17, 2012 11:55
get_links
@macdrifter
macdrifter / formd-pythonista.py
Created October 18, 2012 00:16 — forked from ttscoff/formd-pythonista.py
A modified version of formd for use with Pythonista on iOS
# encoding=utf8
"""
formd by Seth Brown, 02-24-12
modified for iOS use (Pythonista) by Brett Terpstra, 10-17-12
"""
from sys import stdin, stdout
import clipboard
import re
from collections import OrderedDict
@macdrifter
macdrifter / get_links.py
Created October 18, 2012 22:53
get_links