Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
var oldSync = Backbone.sync; | |
Backbone.sync = function(method, model, success, error){ | |
var newSuccess = function(resp, status, xhr){ | |
if(xhr.statusText === "CREATED"){ | |
var location = xhr.getResponseHeader('Location'); | |
return $.ajax({ | |
url: location, | |
success: success | |
}); |
Vagrant::Config.run do |config| | |
config.vm.customize do |vm| | |
vm.memory_size = 1048 | |
vm.name = "Django projects (GIS enabled)" | |
vm.cpu_count = 2 | |
end | |
config.vm.box = "lucid32" | |
config.vm.box_url = "http://files.vagrantup.com/lucid32.box" | |
config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true) |
from neo4j.model import django_model as models | |
class Movie(models.NodeModel): | |
title = models.Property(indexed=True) | |
year = models.Property() | |
href = property(lambda self: ('movie/%s/' % (self.node.id,))) | |
def __unicode__(self): | |
return self.title |
$(function(){ | |
var oldSync = Backbone.sync; | |
Backbone.sync = function(method, model, success, error){ | |
var newSuccess = function(resp, status, xhr){ | |
if(xhr.statusText === "CREATED"){ | |
var location = xhr.getResponseHeader('Location'); | |
return $.ajax({ | |
url: location, | |
success: success |
Some exercises from the Falsy Values workshops.
The good parts:
vagrant@vagrantup:/vagrant/djangoapps/lizard-waterbalance$ bin/django syncdb | |
Traceback (most recent call last): | |
File "bin/django", line 39, in <module> | |
djangorecipe.manage.main('lizard_waterbalance.testsettings') | |
File "/vagrant/djangoapps/lizard-waterbalance/eggs/djangorecipe-0.20-py2.6.egg/djangorecipe/manage.py", line 16, in main | |
management.execute_manager(mod) | |
File "/vagrant/djangoapps/lizard-waterbalance/parts/django/django/core/management/__init__.py", line 438, in execute_manager | |
utility.execute() | |
File "/vagrant/djangoapps/lizard-waterbalance/parts/django/django/core/management/__init__.py", line 379, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) |
[~/projects/documentation/lizardwindowsdocs] | |
$ bin/buildout | |
Develop: '/Users/gijs/projects/documentation/lizardwindowsdocs/.' | |
install_dir /Users/gijs/projects/documentation/lizardwindowsdocs/develop-eggs/tmpYMUvRfbuild | |
Updating test. | |
Updating omelette. | |
Installing console_scripts. | |
Getting distribution for 'coverage==3.4'. | |
install_dir /Users/gijs/projects/documentation/lizardwindowsdocs/eggs/tmpLt9VnW | |
no previously-included directories found matching 'test' |
.mouse, #preview{ | |
position: absolute; | |
background-repeat: no-repeat; | |
height: 22px; | |
min-width: 15px; | |
z-index: 100; | |
} | |
.mouse{ | |
background-image: url('../images/cursor.png'); |
# Offering alternative Chef + Vagrant Riak cluster setup to the following blog post at basho: | |
# http://blog.basho.com/2011/02/04/creating-a-local-riak-cluster-with-vagrant-and-chef/ | |
# Assumes Vagrant 0.7.0+ and VirtualBox 4.0+ | |
# Now you should be able to launch your X (where X=4 in this case) vagrant VMs with the following: | |
# % vagrant up db1 | |
# % vagrant up db2 | |
# % vagrant up db3 | |
# % vagrant up db4 |
brew install git | |
brew update | |
brew install readline | |
brew link readline | |
brew install python | |
brew install postgres | |
brew install postgis | |
brew install gdal | |
brew install geos | |
brew install git |