Skip to content

Instantly share code, notes, and snippets.

@takeo
takeo / gist:4809
Created August 11, 2008 04:37 — forked from defunkt/gist:4754
= Gistr
A simple tool to post gists to tumblr.
== The Problem
Tumblr does not have a way to post code snippets simply and the current solutions are lacking.
@takeo
takeo / mini.rb
Created February 24, 2010 08:32 — forked from defunkt/mini.rb
##
# test/spec/mini 5
# http://gist.github.com/307649
# chris@ozmm.org
#
def context(*args, &block)
return super unless (name = args.first) && block
require 'test/unit'
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) do
def self.test(name, &block)
@takeo
takeo / gist:385818
Created April 30, 2010 21:53 — forked from 3n/gist:385810
// definition of trackEvent method on a global object
$3N = {
trackEvent : function(category, action, label, value){
if (typeof(pageTracker) == "object") pageTracker._trackEvent(category, action, label, value);
else if(typeof(_gaq) == "object") _gaq.push(['_trackEvent', category, action, label, value]);
}
};
tell application "Mail"
set selectedMessages to the selection
set mailboxMap to {{accountName:"Work", archive:"All Mail"}, {accountName:"Gmail", archive:"All Mail"}}
repeat with mapItem in mailboxMap
set archiveMailbox to the mailbox (archive of mapItem) of account (accountName of mapItem)
set messagesToMove to {}
repeat with msg in selectedMessages
if name of the mailbox of msg is "INBOX" then
if name of the account of the mailbox of msg is (accountName of mapItem) then