Skip to content

Instantly share code, notes, and snippets.

View Kronuz's full-sized avatar

Germán Méndez Bravo Kronuz

View GitHub Profile
@Kronuz
Kronuz / debugtoolbar.diff
Created April 13, 2011 17:59
Fixes a couple bugs in django-debug-tolbar
diff -ruN debug_toolbar copy/panels/sql.py debug_toolbar/panels/sql.py
--- debug_toolbar copy/panels/sql.py 2011-04-11 12:32:10.000000000 -0500
+++ debug_toolbar/panels/sql.py 2011-04-13 12:48:38.000000000 -0500
@@ -197,7 +197,7 @@
i += 1
if trans_id:
- self._queries[i][1]['ends_trans'] = True
+ self._queries[i-1][1]['ends_trans'] = True
@Kronuz
Kronuz / _transition.scss.diff
Created April 22, 2011 17:03
Transitions using lists
Index: css3/_transition.scss
index 60487bc..755b4f1 100644
--- a/css3/_transition.scss
+++ b/css3/_transition.scss
@@ -72,7 +72,7 @@ $default-transition-delay: false !default;
// Transition all-in-one shorthand
-@mixin transition(
+@mixin single-transition(
@Kronuz
Kronuz / gist:1072348
Created July 8, 2011 17:43
postgis build failing using homebrew and Mac OS X 10.7
==> Downloading http://postgis.refractions.net/download/postgis-1.5.3.tar.gz
File already downloaded in /Users/kronuz/Library/Caches/Homebrew
/usr/bin/tar xf /Users/kronuz/Library/Caches/Homebrew/postgis-1.5.3.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/postgis/1.5.3 --with-projdir=/usr/local
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/postgis/1.5.3 --with-projdir=/usr/local
configure: WARNING: unrecognized options: --disable-dependency-tracking
checking build system type... x86_64-apple-darwin11.0.0
checking host system type... x86_64-apple-darwin11.0.0
checking how to print strings... printf
checking for gcc... /usr/bin/cc
@Kronuz
Kronuz / gist:1072509
Created July 8, 2011 18:50
postgis build failing using homebrew and Mac OS X 10.7
diff --git a/Library/Formula/postgis.rb b/Library/Formula/postgis.rb
index c1399e6..f677b8b 100644
--- a/Library/Formula/postgis.rb
+++ b/Library/Formula/postgis.rb
@@ -36,7 +36,8 @@ class Postgis < Formula
args = [
"--disable-dependency-tracking",
"--prefix=#{prefix}",
- "--with-projdir=#{HOMEBREW_PREFIX}"
+ "--with-projdir=#{HOMEBREW_PREFIX}",
@Kronuz
Kronuz / gist:1478085
Created December 14, 2011 19:29
CSS3 transitions
function prefixed(props) {
// Function to find out what prefix this browser supports and get the
// prefixed versions of a list of properties.
var prefixes = ['Moz', 'Khtml', 'Webkit', 'O', 'ms'],
elem = document.createElement('div'),
uppers = [],
i;
if (props[0] in elem.style) {
return props;
}
@Kronuz
Kronuz / gist:2662264
Created May 11, 2012 20:37
ImageKit's ImageSpecFieldFile error
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "../apps/sections/views.py", line 48, in sectionpage
response = http.HttpResponse(t.render(c))
File "/Library/Python/2.7/site-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/Library/Python/2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/Library/Python/2.7/site-packages/django/template/base.py", line 823, in render
@Kronuz
Kronuz / gist:2662379
Created May 11, 2012 20:59
...ImageSpecFieldFile error
diff --git a/apps-ext/imagekit/models/fields/files.py b/apps-ext/imagekit/models/fields/files.py
index e206377..e98b7d9 100755
--- a/apps-ext/imagekit/models/fields/files.py
+++ b/apps-ext/imagekit/models/fields/files.py
@@ -111,7 +111,9 @@ class ImageSpecFieldFile(ImageFieldFile):
"""
name = getattr(self, '_name', None)
if not name:
- filename = self.source_file.name
+ filename = self.__dict__.get('name')
@Kronuz
Kronuz / gist:2663040
Created May 11, 2012 23:15
ImageSpecFieldFile error
Traceback (most recent call last):
File "../libs/celery/concurrency/processes/pool.py", line 239, in run
return self.body()
File "../libs/celery/concurrency/processes/pool.py", line 288, in body
put(task)
File "/Library/Python/2.7/site-packages/django/db/models/fields/files.py", line 134, in __getstate__
return {'name': self.name, 'closed': False, '_committed': True, '_file': None}
File "../apps-ext/imagekit/models/fields/files.py", line 114, in name
filename = self.source_file.name
File "../apps-ext/imagekit/models/fields/files.py", line 18, in source_file
@Kronuz
Kronuz / gist:3383270
Created August 17, 2012 22:32
Celery 3.0 and "Stale pidfile exists. Removing it." message
--- celery/apps/beat.py
+++ celery/apps/beat.py
@@ -12,6 +12,7 @@
"""
from __future__ import absolute_import
+import atexit
import socket
import sys
@Kronuz
Kronuz / gist:3666938
Created September 7, 2012 15:03
Xapian 1.3.0 homebrew formula
require 'formula'
class XapianBindings < Formula
homepage 'http://xapian.org'
# url 'http://oligarchy.co.uk/xapian/1.2.12/xapian-bindings-1.2.12.tar.gz'
# sha1 'f75921b43041e6e672821c51fe29dbbaee491791'
url 'http://oligarchy.co.uk/xapian/1.3.0/xapian-bindings-1.3.0.tar.gz'
sha1 'bfb4639e968b012e5780c2a3d673963afa90b6fe'
end