Skip to content

Instantly share code, notes, and snippets.

View vinilios's full-sized avatar

Kostas Papadimitriou vinilios

  • GRNet
  • Athens, Greece
View GitHub Profile
@vinilios
vinilios / install xapian inside virtualenv
Created October 1, 2009 14:53
xapian local installation
apt-get install zlib1g-dev
apt-get install g++
export VENV=$VIRTUAL_ENV
mkdir $VENV/packages && cd $VENV/packages
curl -O http://oligarchy.co.uk/xapian/1.0.16/xapian-core-1.0.16.tar.gz
curl -O http://oligarchy.co.uk/xapian/1.0.16/xapian-bindings-1.0.16.tar.gz
tar xzvf xapian-core-1.0.16.tar.gz
@vinilios
vinilios / gist:199673
Created October 2, 2009 11:22
python utf 8
# -*- coding: utf-8 -*-
@vinilios
vinilios / common django requirements
Created October 22, 2009 13:04
common django requirements
BeautifulSoup==3.1.0.1
http://dist.repoze.org/PIL-1.1.6.tar.gz
django-debug-toolbar
-e svn+http://code.djangoproject.com/svn/django/trunk/#egg=django
-e hg+http://bitbucket.org/offline/django-annoying/#egg=django-annoying
-e git://github.com/alex/django-templatetag-sugar.git@#egg=django-templatetag-sugar
-e hg+http://bitbucket.org/andrewgodwin/south/#egg=south
-e git+git://github.com/django-extensions/django-extensions.git#egg=django-extensions
@vinilios
vinilios / django custom aggregate
Created November 4, 2009 12:11
custom django aggregate
class MyMax(Aggregate):
sql_function = 'CHAR_LENGTH'
"""A base class to make it easy for end users to define their own
custom SQL aggregates.
The subclass should define the following two class properties:
* sql_function - the name of the SQL function to invoke
Optionally, you can define
* sql_template - a format string that is used to compose the
@vinilios
vinilios / jquery plugin template
Created November 16, 2009 13:14
jquery plugin
/**
* reverseText plugin for jQuery
* v1.0
* Reverses text within the selected nodes.
*
* By Craig Buckler, Optimalworks.net
*
* As featured on SitePoint.com
* Please use as you wish at your own risk.
*/
@vinilios
vinilios / symfony 1.0 assets patch
Created December 3, 2009 13:14
symfony 1.0 assets patch
Index: lib/helper/AssetHelper.php
===================================================================
--- lib/helper/AssetHelper.php (revision 15043)
+++ lib/helper/AssetHelper.php (working copy)
@@ -159,11 +159,23 @@
$sourceOptions = (func_num_args() > 1 && is_array($sources[func_num_args() - 1])) ? array_pop($sources) : array();
$html = '';
+
+ $before = '';
@vinilios
vinilios / jquery marquee gallery
Created December 7, 2009 21:17
marquee style image gallery
@vinilios
vinilios / update linker, compiler.... etc paths
Created December 7, 2009 23:56
update linker, compiler.... etc paths
#!/bin/bash
LIB_NAME=mylib
LIB_PREFIX=~/opt/mylib-0.1
export DYLD_LIBRARY_PATH=$LIB_PREFIX/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LIB_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$LIB_PREFIX/include
export ACLOCAL_PATH=$LIB_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$LIB_PREFIX/lib/pkgconfig
PATH=$LIB_PREFIX/bin:$PATH
PS1="[custom lib shell] \w @ "
@vinilios
vinilios / django wsgi using uwsgi
Created January 19, 2010 00:29
django uwsgi compatible wsgi file
# name it something like mysitedotcom_wsgi
# /usr/bin/uwsgi -s 127.0.0.1:46235 -t 10 -M -p 1 -C -w mysitedotcom_wsgi -H ~/venvs/virtualenv
import sys, os
import django.core.handlers.wsgi
# lets redirect print statements to stderr
# (this is useful to redirect print statements to web servers error log file)
sys.stdout = sys.stderr
@vinilios
vinilios / uwsgi update on code change
Created January 19, 2010 00:32
uwsgi update on code change
#!/usr/bin/python
import os, sys, subprocess
from pyinotify import *
# the watch manager stores the watches and provide operations on watches
wm = WatchManager()
# watched events
mask = IN_DELETE | IN_CREATE | IN_MODIFY