Skip to content

Instantly share code, notes, and snippets.

http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart1411.flv
http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart2306.flv
http://blip.tv/file/get/Richhickey-ClojureSequences733.flv
http://blip.tv/file/get/Richhickey-ClojureConcurrency252.flv
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers2Of2680.mov
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers1Of2174.flv
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart2299.mov
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart1372.flv
http://blip.tv/file/get/Richhickey-HammockdrivenDevelopment465.mov
http://blip.tv/file/get/Richhickey-MichaelFogusFertileGroundTheRootsOfClojure492.mov

Keybase proof

I hereby claim:

  • I am olifante on github.
  • I am olifante (https://keybase.io/olifante) on keybase.
  • I have a public key whose fingerprint is 4A3A 7EC3 825E A966 8011 8FD4 DF27 FD81 9ADF E21B

To claim this, I am signing this object:

Upgrade Django from 1.1 to 1.5.1. This highlights some of the issues that one may encounter when updating Django. It's not possible to cover every case, but this should provide a good general starting point.

Change to DATABASES variable in settings.py.

Django now supports multiple databases and changes are needed to how the database connections are defined.

  • Changed in Django 1.2
  • Change Required by Django 1.4
  • Source:
from django.core.paginator import ObjectPaginator
class QuickObjectPaginator(ObjectPaginator):
max_safe_pages = 0
def __init__(self, object_list, per_page, orphans=0, max_safe_pages=0):
self.max_safe_pages = max_safe_pages
super(QuickObjectPaginator, self).__init__(object_list, per_page, orphans)
def validate_page_number(self, page_number):
"Memcached cache backend"
from django.core.cache.backends import memcached
from django.utils.encoding import smart_unicode, smart_str
MIN_COMPRESS_LEN = 150000
class CacheClass(memcached.CacheClass):
def add(self, key, value, timeout=None, min_compress_len=MIN_COMPRESS_LEN):
if isinstance(value, unicode):
@olifante
olifante / xml2db.rb
Created January 10, 2013 18:32 — forked from rkumar/xml2db.rb
#!/usr/bin/env ruby
=begin
* Name: xml.rb
* Description parses xml iTunes Music Library and inserts into database
so other apps can use, rather than each time parsing xml file
* Author: Original - Aaron Patterson (xml parsing portion)
http://groups.google.com/group/nokogiri-talk/browse_thread/thread/97973521c6f5f0dc
* Additions by rkumar
* Date: 2010-08-04
* License:
@olifante
olifante / itunes.sql
Last active December 10, 2015 22:49 — forked from rkumar/itunes.sql
/* create tables to store itunes music library data for quick access
- olifante 2013 January - added columns used by iTunes 11.0.1
- rkumar 2010 July
*/
-- drop table tracks;
create table tracks (
album_artist VARCHAR(50),
album_rating_computed INTEGER,
album_rating INTEGER,
album VARCHAR(50),
@olifante
olifante / gist:5306079
Last active December 15, 2015 18:48
Líder parlamentar do PSD admite extinção do Tribunal Constitucional: http://expresso.sapo.pt/lider-parlamentar-do-psd-admite-extincao-do-tribunal-constitucional=f734498
Líder parlamentar do PSD admite extinção do Tribunal Constitucional
http://expresso.sapo.pt/lider-parlamentar-do-psd-admite-extincao-do-tribunal-constitucional=f734498
A propósito da polémica que envolve a nomeação dos três novos juízes para o Tribunal Constitucional, o líder do grupo parlamentar do PSD Luís Montenegro considera que "muita coisa pode ser revista".
17:22 Quinta feira, 21 de junho de 2012
Na sequência da polémica com o PS, por causa da escolha dos candidatos a juízes para o Tribunal Constitucional, o líder do grupo parlamentar do PSD admite a extinção deste orgão. Em entrevista à Rádio Renascença, Luís Montenegro diz que muita coisa pode ser revista no futuro, até a existência do próprio Tribunal Constitucional.
"O PSD já teve um líder que o defendeu e eu também, a título meramente pessoal, dou abertura para a hipótese de (...) passarmos a ter uma secção constitucional no Supremo Tribunal de Justiça, com isso recolocando em cima da mesa não só o método de eleição e de recrutamento dos juíze

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

var warning = function () {
console.log("I didn't understand you, please play again.")
}
var win = function () {
console.log("You win!!!!")
}
var lose = function () {
console.log("You lose :-(")
}
var fight = function () {