Skip to content

Instantly share code, notes, and snippets.

document.addEventListener("keydown", function(e) {
if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)) {
e.preventDefault();
$('form[action="/templates/publish"]').submit()
}
}, false);
lock(client, "myLock", false, function(locked,done) {
if(locked) {
setTimeout(done, 1000);
} else {
console.log('Somebody is already doing the job, I give up')
}
});
{ "checksum" : "-",
"culprit" : "cacheops.query._clone",
"id" : "-",
"level" : "error",
"logger" : "root",
"modules" : { "cacheops" : "0.9.2",
"dajax" : "0.8.4.beta",
"dajaxice" : "0.2.0.0.beta",
"django" : "1.4",
"djcelery" : "2.4.2",
@divadrei
divadrei / gist:2511533
Created April 27, 2012 18:22
setup iterm2 compatible tmux on debian6
echo "deb http://backports.debian.org/debian-backports squeeze-backports main contrib" >> /etc/apt/sources.list
echo "deb http://ftp.de.debian.org/debian sid main" >> /etc/apt/sources.list
apt-get update
apt-get upgrade
apt-get install libevent-dev autoconf pkg-config gcc g++ libncurses5-dev make
mkdir tmux
cd tmux
wget "http://iterm2.googlecode.com/files/tmux-for-iTerm2-20120203.tar.gz"
tar -zxf tmux-for-iTerm2-20120203.tar.gz
cd tmux-for-iTerm2-20120203/
@divadrei
divadrei / gist:2413090
Created April 18, 2012 11:50
pipeline
PIPELINE_AUTO = False
PIPELINE_VERSION = True
PIPELINE_VERSIONING = 'pipeline.versioning.git.GitRevVersioning'
PIPELINE_CSS_COMPRESSOR = None
PIPELINE_JS_COMPRESSOR = None
PIPELINE_CSS = {
'base': {
'source_filenames': (
'css/style.css',
from django.db.models.query import QuerySet
from copy import deepcopy
from django.db import connection
#from querymanager import Manager
REPR_OUTPUT_SIZE = 20
CHUNK_SIZE = 100
ITER_CHUNK_SIZE = CHUNK_SIZE
@divadrei
divadrei / example
Created January 20, 2012 14:06
tag-euractv
{
"title": {
"language": "fr",
"format": "text",
"content": "première partie (sans doute le titre)"
},
"header": {
"language": "fr",
"format": "text",
"content": "deuxième partie (sans doute le header)"
@divadrei
divadrei / specifs
Created January 20, 2012 13:58
tag-euractv
{
"description": "document",
"type": "object",
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"properties": {
"content": {
"type": "string",
"required": true
/////////////////
// Semantic.gs // for Stylus: http://learnboost.github.com/stylus/
/////////////////
// Defaults which you can freely override
column-width = 60px
gutter-width = 20px
columns = 12
// Utility variable — you should never need to modify this