My bookmarklet “Copy URL and title” will save you from having to copy/paste twice. To use it: Drag the previous link to your bookmark bar, rename as desired, and click on it.
Update 2011-01-07: Improved version
الأربعاء، 25 فبراير 2009
Offline arbeiten mit Firefox
Link: RSS unplugged - Wie man seine Feeds auch offline lesen kann
Es sind ein paar ganz nette universell interessante Firefox-Plugins dabei.
Es sind ein paar ganz nette universell interessante Firefox-Plugins dabei.
الجمعة، 13 فبراير 2009
Generate emails with mailto URLs and Python
Scenario: You want to send several emails where only small things change. This sounds like a job for a mail merge program. But if you use mailto: links and Python, you get a nice shell-based solution. This combination also has the advantage of opening each generated email in your email client so that you can take one last look before sending it.
mailto: URL syntax
"mailto:" recipients ( "?" key "=" value ("&" key "=" value)* )?
Open mailto URLs with Python
Related:
Flattr
mailto: URL syntax
"mailto:" recipients ( "?" key "=" value ("&" key "=" value)* )?
- recipients: comma-separated email addresses (no spaces; Outlook needs semicolons instead of commas)
- value: should be URL-encoded (e.g. space becomes %20)
- key: subject, cc, bcc, body
- Example: mailto:joe@example.com,jane@example.com?subject=hello&body=How%20are%20you%3F
Open mailto URLs with Python
#!/usr/bin/python
from urllib import quote
import webbrowser
def mailto(recipients, subject, body):
"recipients: string with comma-separated emails (no spaces!)"
webbrowser.open("mailto:%s?subject=%s&body=%s" %
(recipients, quote(subject), quote(body)))
body_template = """Hello %(name)s!
How are you?"""
def gen(email, name):
mailto(email, "Hi!", body_template % locals())
gen("joe@example.com", "Joe")
gen("jane@example.com,jill@example.com", "Jane and Jill")
Related:
Flattr
الاثنين، 9 فبراير 2009
Advanced HTML forms
The tutorial “Creating accessible Web forms” shows how much is already possible with HTML forms (even without XForms).
الأربعاء، 4 فبراير 2009
incsync – incremental backups with rsync on Unix
Time Machine was always a bit troublesome for me on Mac OS X, so I did some research about how to do incremental backups with open source software. The result is the script presented in this post.
Rsync is really cool for backups (if you need bi-directional file synchronization, take a look at Unison): If you specify a source and a target directory, rsync makes sure that files are copied from target to source or removed from target until both directories have the same content. Thus, whatever the state of source and target, after invoking rsync, the target is an exact copy of the source. Rsync has command line options that allow one to only back up changes relative to a “previous” directory:
- Usage: incsync.sh [timestamp]
- No arguments: Perform a new backup with the current time as a timestamp.
- One argument – a timestamp: Continue a previous backup.
- What it does: Each time, it is invoked, only what has changed (since the last invocation) is backed up, in a new directory with a time stamp.
- How it works: incsync uses the open source tool rsync for incremental backups. rsync uses Unix hard links (references to files) to do so: Before creating a new backup, one makes a complete copy of the last backup, but the copy does not contain files, only hard links to files. Then one brings the copy up to date with the source directory. Afterwards, the copy looks like a complete backup, but consumes relatively little space on disk. The kicker is that you could now delete the previous backup and the newly created directory would still contain a complete backup. The reason lies in Unix’s handling of hard links: it only deletes a file after there are no more references to it.
- Inspiration: This script has been inspired by the article “Time Machine for every Unix out there”.
- Download: on GitHub at incsync.
الأحد، 1 فبراير 2009
JavaScript is becoming a nice language
Apart from impressive speed improvements via Google Chrome's V8 or Firefox's TraceMonkey, I had forgotten that new versions of JavaScript had some really nice language features (I still hope that optional types make it into ECMAScript 4). The article “Pythonic Javascript, it's Python with braces!” reminded me.
What's new in client-side Java?
“Client-side Java's evolutionary leap” gives a great overview of interesting things that happened for client-side Java in 2008. Recommended additional reading:
- “Year in Review: What to expect in Java SE 7”
- “Project Jigsaw” by Mark Reinhold. An update on modularity constructs in Java 7.
الاشتراك في:
الرسائل (Atom)