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 / thepresscliker.user.js
Created February 10, 2015 23:30
thepressproject.gr userscript
// @name thepressproject.gr clicker
// @namespace http://thepressproject.gr/#clickerscript
// @version 0.0.1
// @author Kostas Papadimitriou <kpap@grnet.gr>
// @description Fix thepressproject.gr links and context menu annoyances.
// @domain thepressproject.gr
// @domain www.thepressproject.gr
// @match http://www.thepressproject.gr/*
// @match https://www.thepressproject.gr/*
// @match https://thepressproject.gr/*
@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 / 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
@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 / default mysql storage engine for the current session
Created March 8, 2010 00:46
default mysql storage engine for the current session
SET storage_engine=MYISAM;