Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
⌘+X | delete line |
⌘+↩ | insert line after |
⌘+⇧+↩ | insert line before |
⌘+⇧+↑ | move line (or selection) up |
# -*- coding: utf-8 -*- | |
import codecs | |
import cStringIO | |
import csv | |
import json | |
import sys | |
""" | |
Convert Django json datadump fields into csv. |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
⌘+X | delete line |
⌘+↩ | insert line after |
⌘+⇧+↩ | insert line before |
⌘+⇧+↑ | move line (or selection) up |
Ext.override(Ext.form.Field, { | |
setFieldLabel : function(text) { | |
if (this.rendered) { | |
this.el.down('.x-form-label').update(text); | |
} | |
this.fieldLabel = text; | |
} | |
}); |
Vagrant::Config.run do |config| | |
# Base Ubuntu box | |
config.vm.box = "lucid32" | |
# The url from where the 'config.vm.box' box will be fetched if it | |
# doesn't already exist on the user's system. | |
config.vm.box_url = "http://files.vagrantup.com/lucid32.box" | |
# Boot with a GUI so you can see the screen. (Default is headless) | |
# config.vm.boot_mode = :gui |
vagrant@lucid32:~$ sudo apt-get upgrade | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following packages have been kept back: | |
linux-generic linux-image-generic | |
The following packages will be upgraded: | |
apt apt-transport-https apt-utils base-files bind9-host dhcp3-client dhcp3-common dnsutils fuse-utils initscripts libbind9-60 libcurl3-gnutls libdbus-1-3 libdns64 libfuse2 | |
libgssapi-krb5-2 libisc60 libisccc60 libisccfg60 libk5crypto3 libkrb5-3 libkrb5support0 libldap-2.4-2 liblwres60 libpam-modules libpam-runtime libpam0g libparted0debian1 | |
libpng12-0 linux-firmware linux-libc-dev login logrotate ntpdate parted passwd perl perl-base perl-modules python-apt rsync sysv-rc sysvinit-utils tzdata w3m xkb-data |
vagrant@lucid32:~$ sudo apt-get install build-essential module-assistant linux-headers-$(uname -r) dkms | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
build-essential is already the newest version. | |
module-assistant is already the newest version. | |
The following extra packages will be installed: | |
linux-headers-2.6.32-28 | |
Recommended packages: | |
linux-headers-2.6-686 linux-headers-2.6-amd64 linux-headers-generic linux-headers |
vagrant@lucid32:~$ sudo apt-get upgrade | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following packages have been kept back: | |
linux-generic linux-image-generic | |
The following packages will be upgraded: | |
apt apt-transport-https apt-utils base-files bind9-host dhcp3-client dhcp3-common dnsutils fuse-utils initscripts libbind9-60 libcurl3-gnutls libdbus-1-3 libdns64 libfuse2 | |
libgssapi-krb5-2 libisc60 libisccc60 libisccfg60 libk5crypto3 libkrb5-3 libkrb5support0 libldap-2.4-2 liblwres60 libpam-modules libpam-runtime libpam0g libparted0debian1 | |
libpng12-0 linux-firmware linux-libc-dev login logrotate ntpdate parted passwd perl perl-base perl-modules python-apt rsync sysv-rc sysvinit-utils tzdata w3m xkb-data |
class Event(models.Model): | |
# Setup event types | |
TYPE_OTHER = 0 | |
TYPE_FUNERAL = 1 | |
TYPE_WEDDING = 2 | |
TYPE_CHOICES = ( | |
(TYPE_OTHER, 'Other'), | |
(TYPE_FUNERAL, 'Funeral'), | |
(TYPE_WEDDING, 'Wedding'), | |
) |
var yourClass = new Class({ | |
Implements: [Options], | |
options: { | |
yourOption: '' | |
}, | |
initialize: function(options) { | |
this.setOptions(options); | |
}, |
Request.Twitter = new Class({ | |
Extends: Request.JSONP, | |
options: { | |
linkify: true, | |
url: 'http://twitter.com/statuses/user_timeline/{term}.json', | |
data: { | |
count: 5 | |
} |