Skip to content

Instantly share code, notes, and snippets.

@tvon
tvon / ubiquity-todoist.js
Created February 6, 2009 19:32
Todoist plugin for Ubiquity
TODOIST_DUE = "";
TODOIST_PRIORITY = 4;
Todoist = {
setToken:function(key){
if (!Application.prefs.has("todoist_token")) {
Application.prefs.setValue("todoist_token", key);
} else {
var new_key = Application.prefs.get("todoist_token");
new_key.value = key;
body { margin: 0; color: #fff; background: #000; overflow: hidden; }
audio { visibility: hidden; }
#header h1, #apple div.icon { color: transparent; }
#apple, #header, #safari { position: absolute; top: 40%; left: 50%; }
#apple { width: 600px; height: 538px; margin: -290px 0 0 -290px; overflow: hidden; }
#apple div { position: absolute; width: 600px; height: 538px; opacity: 0; }
#apple div.icon { z-index: 3; background: url(http://images.apple.com/safari/welcome/images/apple_icon.png) no-repeat 233px 184px; }
@tvon
tvon / kristol-memo.markdown
Created March 3, 2009 19:04
"Bill Kristol’s 1993 Memo Calling For GOP To Block Health Care Reform" converted to Markdown format from sources here: http://is.gd/lAKi

Defeating President Clinton's Health Care Plan

What follows is the first in what will be a series of political strategy memos prepared by The Project for the Republican Future. The topic of this memo is President Clinton's health care reform proposal, the single most ambitious item on the Administration's domestic policy agenda.

These four pages are an attempt to describe a common political strategy for Republicans in response to the Clinton health care plan. By examining the president's own strategy and tactics, this memo suggests how Republicans might reframe the current health care debate, offer a serious alternative, and, in the process, defeat the president's plan outright.

Nothing in these pages is intended to supplant the many thoughtful analysis of the Clinton health care plan already produced by republican and others, analyses which have done much to expose both its glaring weaknesses and immediate dangers. In fact, this memo borrows heavily from articles and papers prepared by conserva

#!/usr/bin/env python
"""
This script aims at providing a simple way to bootstrap a self-contained django project.
In short, it makes a few trivial decisions for you.
To those who use the Django framework this may seem a bit unecessary, but I believe that
it could be easier to get started with django, without having to impose minor decisions
on new users such as where to place templates and basic media files.
@tvon
tvon / admin.py
Created April 16, 2009 13:47
Customizing User list view and edit form in Django
from django.contrib import admin
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from forms import UserChangeForm
class UserAdmin(BaseUserAdmin):
list_display = ('username', 'last_name', 'first_name', 'is_superuser', 'is_staff')
#!/bin/sh
#
# Copyright (c) 2002-2004 Michael Telahun Makonnen. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
@tvon
tvon / freeciv.net-bootstrap.sh
Created March 7, 2011 21:18
A script to bootstrap (and build) freeciv.net on Ubuntu 10.10
#!/bin/bash
basedir="${HOME}/freeciv-build"
srcdir="${basedir}/freeciv-web"
destdir="${basedir}/build"
# User will need permissions to create a database
mysql_user="root"
mysql_pass="changeme"
@tvon
tvon / homebrew-macvim.sh
Created April 8, 2011 18:48
Use homebrew installation of macvim for terminal vim command.
if [ -x `which brew` ]; then
macvim_version=`brew list --versions macvim | sed 's/.* \([0-9\.\-]*\)$/\1/'`
if [ -n "${macvim_version}" ]; then
alias vim=`brew --prefix`/Cellar/macvim/${macvim_version}/MacVim.app/Contents/MacOS/Vim
fi
fi
@tvon
tvon / pow.sh
Created April 8, 2011 18:52
"pow" shell function for quick linking of directories to ~/.pow (if using http://pow.cx)
function pow {
if [ -d "`cd $1; pwd`" ]; then
ln -s "`cd $1; pwd`" ~/.pow/
fi
}
@tvon
tvon / raw-client.rb
Created August 29, 2011 20:42
raw api file upload
#!/usr/bin/env ruby
require "net/http"
require "uri"
url = 'http://example.com/submissions.json'
token = 'TOKEN HERE'
boundary = "pop-pop"
uri = URI.parse(url)