Skip to content

Instantly share code, notes, and snippets.

javascript:
url='https://mail.google.com/mail?view=cm&tf=0&to=&su=';
if ("" != document.getSelection()) {
url += '[TUMBI]: ' + document.getSelection();
}
window.open (url,
'gmailForm',
javascript:
url='https://mail.google.com/mail?view=cm&tf=0&to=&su=';
if ("" != document.getSelection()) {
url += '[TUMBI]: ' + document.getSelection() + "&body=" + document.URL;
}
window.open (url,
'gmailForm',
import com.gmongo.GMongo
/*
Details example
[weight: 47, weight_units: "lbs", model_num: 1]
*/
/*
Price example
[retail: 589700, sale: 489700]
could also include
import com.gmongo.GMongo
class Details {
def weight;
def weight_units;
def model_num;
Details(weight, weight_units, model_num) {
this.weight = weight;
this.weight_units = weight_units;
@timvisher
timvisher / gist:778825
Created January 13, 2011 23:21
A simple script for use with Quicksilver et al for ejecting all your mounted disks.
tell application "Finder"
repeat with theDisk in (get disks)
if (get ejectable of theDisk) then
eject theDisk
end if
end repeat
end tell
@timvisher
timvisher / gist:784576
Created January 18, 2011 15:27
Code for a Remember the Milk bookmarklet for saving the current page via your import address and GMail
url = 'https://mail.google.com/mail?view=cm&tf=0&to=';
url += encodeURIComponent('you@rmilk.com') + '&su=';
if("" != document.getSelection()) {
url += document.getSelection();
}
url += "&body=url:" + encodeURIComponent(document.URL);
window.open(url, 'gmailForm', 'scrollbars=yes,width=680,height=510,top=175,left=200,status=no,resizable=yes');
void(0);
@timvisher
timvisher / gist:784582
Created January 18, 2011 15:28
Script for popping up a GMail compose window with info about the current page in it.
url='https://mail.google.com/mail?view=cm&tf=0&to=&su=';
if("" != document.getSelection()) {
url += encodeURIComponent('[TUMBI]: ' + document.getSelection()) + "&body=" + encodeURIComponent(document.URL);
}
window.open(url, 'gmailForm', 'scrollbars=yes,width=680,height=510,top=175,left=75,status=no,resizable=yes');
void(0);
@timvisher
timvisher / gist:784744
Created January 18, 2011 16:56
wallpapers!-core
(ns wallpaper-manager-core.core
(:import [java.io File FileInputStream]
javax.imageio.ImageIO))
;; Properties
(def wallpaper-source (str (System/getProperty "user.home") "/Downloads/"))
(def wallpaper-dest (str (System/getProperty "user.home") "/Pictures/Wallpaper"))
@timvisher
timvisher / gist:787954
Created January 20, 2011 14:25
Script to scale and crop a bunch of wallpapers selected in Finder.app
tell application "Finder" to set wallpapers to selection
tell application "Image Events"
repeat with currentWallpaper in wallpapers
set theWallpaper to open (currentWallpaper as alias)
tell theWallpaper
repeat with dim in [{1920, 1080}, {1280, 800}]
-- Scale and Crop to current dimensions
scale to size (get item 1 of dim)
crop to dimensions dim
@timvisher
timvisher / gist:792553
Created January 23, 2011 23:02
A little (fragile!) javascript to 'fix' TD Bank's online banking log in screen to work with 1Password
javascript:parent.main.document.getElementsByName('user')[0].setAttribute('type', 'text')