Skip to content

Instantly share code, notes, and snippets.

@monsieuroeuf
monsieuroeuf / Procrastinate.rb
Created December 16, 2011 03:17
rb-appscript to delay a selected event in Things by one day
#!/usr/bin/env ruby -wKU
require "rubygems"
require 'appscript'
require "date"
things = Appscript.app('Things.app')
tomorrow = DateTime.now.next_day
things.selected_to_dos.get.each { |todo| things.schedule(todo, :for => tomorrow) }
@monsieuroeuf
monsieuroeuf / Add to Things.rb
Created December 16, 2011 03:20
Make a new To Do in Things, based on the name and URL of the currently selected item in NetNewsWire.
#!/usr/bin/env ruby
# coding: utf-8
# Ian Haigh - thejoyofappscript.com
# Make a new To Do in Things, based on the name and URL of the currently
# selected item in NetNewsWire. The new To Do goes slap bang into the "Someday"
# category. Handy for temporary bookmarks for things that you want to check
# out later but aren't suitable for Instapaper, like video.
@monsieuroeuf
monsieuroeuf / gist:3711607
Created September 13, 2012 03:13
Use xmlstarlet to look for text from Final Cut Pro 7.0 XML, sorting by start time.
xml sel -t -m '//generatoritem[effect/effectid="Text"]' -s A:N:U start -m 'effect/parameter[name="Text"]' -v value -n FILENAME
@monsieuroeuf
monsieuroeuf / gist:3916085
Last active October 11, 2018 13:53
Proportional scale with Ease and Wizz inOutBack #easeandwizz
// Ease and Wizz 2.0.2 : inOutBack : All keyframes
// Ian Haigh (http://ianhaigh.com/easeandwizz/)
// Last built: 2012-09-26T16:53:49+10:00
// some defaults
var p = 0.8; // period for elastic
var a = 50; // amplitude for elastic
var s = 1.70158; // overshoot amount for "back"
function easeandwizz_inOutBack(t, b, c, d) {
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
@monsieuroeuf
monsieuroeuf / FCP_marker_generator.rb
Created November 16, 2012 02:13
Spits out a tab delimited bunch of markers for importing into Final Cut Pro, for use with MarkerTool
#!/usr/bin/env ruby -wKU
# by Ian Haigh
# http://ianhaigh.com/
# for use with MarkerTool
# http://www.spherico.de/filmtools/markerTool/index.html
FRAME_DURATION = 0.04
require "timecode"
@monsieuroeuf
monsieuroeuf / Reveal this file.py
Created December 13, 2012 06:49
My first evar Sublime Text 2 command. Reveals, alluringly, the current file in the OS X Finder.
import sublime, sublime_plugin, subprocess
class RevealThisFileCommand(sublime_plugin.TextCommand):
def run(self, edit):
path = self.view.file_name()
subprocess.call(["open", "-R", path])
@monsieuroeuf
monsieuroeuf / E&W with no keyframes.js
Last active April 24, 2023 11:54
An example of using an Ease and Wizz equation in an expression, without relying on keyframes.
function easeandwizz_inOutExpo(t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
}
moveDuration = 2;
moveStart = inPoint;
moveEnd = moveStart+moveDuration;
@monsieuroeuf
monsieuroeuf / All E&W functions.js
Created July 22, 2013 05:45
All of the Ease and Wizz functions, as adapted from Robert Penner's easing equations.
function easeandwizz_inBack(t, b, c, d) {
return c*(t/=d)*t*((s+1)*t - s) + b;
}
function easeandwizz_inOutBack(t, b, c, d) {
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
function easeandwizz_outBack(t, b, c, d) {
@monsieuroeuf
monsieuroeuf / vcard-to-csv.py
Last active December 25, 2015 05:59
Parse vcard file[s] generated by Contacts.app on OS X, and spit out some csv values suitable for use with Campaign Monitor etc.
#!/usr/bin/env python
import vobject
import sys
for fname in sys.argv[1:]:
f = open(fname)
v = vobject.readComponents(f)
while True:
@monsieuroeuf
monsieuroeuf / Ease and Wizz elastic in one dimension.js
Last active October 11, 2018 13:57
How to use Ease and Wizz's elastic easing in one dimension, even when applied to a 2D property like scale. Line 60 is where the magic happens. #easeandwizz
// Ease and Wizz 2.0.4 : outElastic : All keyframes
// Ian Haigh (http://ianhaigh.com/easeandwizz/)
// Last built: 2013-07-05T11:46:51+10:00
// some defaults
var p = 0.81; // period for elastic
var a = 50; // amplitude for elastic
var s = 1.70158; // overshoot amount for "back"
function easeandwizz_outElastic(t, b, c, d, a, p) {
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (!a || a < Math.abs(c)) { a=c; var s=p/4; }