Skip to content

Instantly share code, notes, and snippets.

View elishowk's full-sized avatar
🗑️
Full-stack freelancer (node&python mostly)

elias showk elishowk

🗑️
Full-stack freelancer (node&python mostly)
View GitHub Profile
1713 elishowk@miner:~/code/PyTextMiner$ git push origin master
To git@github.com:elishowk/PyTextMiner.git
! [rejected] master -> master (non-fast forward)
error: failed to push some refs to 'git@github.com:elishowk/PyTextMiner.git'
/home/elishowk/code/PyTextMiner/src/PyTextMiner/StopWord/__init__.py:111: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if stopngram[i] == ngram[i]:
@elishowk
elishowk / dynamic_get_class.py
Created December 10, 2010 10:27
dynamically gets a class given its name and the name of its module
def dynamic_get_class(mod_name, class_name):
"""returns a class given its name"""
mod = __import__(mod_name, globals(), locals(), [class_name])
return getattr(mod, class_name)
@elishowk
elishowk / neo4j.py on debian
Created February 3, 2011 12:40
how to install neo4j.py component
* install jpype and maven:
sudo apt-get install python-jpype mvn2
* set $JAVA_HOME in your .bashrc or environment:
export JAVA_HOME="/usr/lib/jvm/java-6-sun/"
OR
export JAVA_HOME="/usr/lib/jvm/java-6-openjdk/"
* download it from : http://components.neo4j.org/neo4j.py/
* edit pom.xml, removing the "<parent>" tag at the beginning
* execute : mvn install
* as the setup.py provided with neo4j.py is broken, you should copy the src/main/python/neo4j directory either with your python system librairies or along with your code to get it imported locally
@elishowk
elishowk / gist:869510
Created March 14, 2011 17:31
fix the cx_Freeze 4.2.2 "no initscript named Console" error

edit the /usr/local/lib/python2.6/dist-packages/cx_Freeze-4.2.2-py2.6-linux-i686.egg/cx_Freeze/freeze.py line 182: then replace : argsSource.base = self._GetFileName("initscripts", name) by : argsSource.base = self._GetFileName("bases", name)

the initscripts directory no more exists !!

@elishowk
elishowk / _json_response.py
Created June 1, 2011 18:09
_json_response instaed of modifying jsonify
def _json_response(responsedict={}, statuscode=200):
return make_response(
json.dumps(dict(responsedict)),
statuscode,
None,
'application/json',
'application/json')
@elishowk
elishowk / postprocess_sekizai.py
Created February 10, 2012 15:07 — forked from timmyomahony/postprocess_sekizai.py
django-sekizai postprocessor for enabling django-compressor compatibility
"""
Get django-sekizai, django-compessor (and django-cms) playing nicely together
re: https://github.com/ojii/django-sekizai/issues/4
using: https://github.com/jezdez/django_compressor.git
and: https://github.com/ojii/django-sekizai.git@0.5
"""
from compressor.templatetags.compress import CompressorNode
from django.template.base import *
def compress(data, name):
@elishowk
elishowk / gist:3946440
Created October 24, 2012 14:39
Questionnaire entretien dev web

Questionnaire entretien dev web

@version 1.1

Contributors

@bentruyman (http://bentruyman.com/), @roger_raymond (http://twitter.com/iansym), @ajpiano (http://ajpiano.com/), @paul_irish (http://paulirish.com/), @SlexAxton (http://alexsexton.com/), @boazsender (http://boazsender.com/), @miketaylr (http://miketaylr.com/), @vladikoff (http://vladfilippov.com/), @gf3 (http://gf3.ca/), @jon_neal (http://twitter.com/jon_neal), @wookiehangover (http://wookiehangover.com/) and @darcy_clarke (http://darcyclarke.me)

Veille Techno

@elishowk
elishowk / .jslintrc
Created October 30, 2012 09:31
.jslintrc
/* jslint browser: true, regexp: true */
/* global jQuery, $ */
/* vim: set ft=javascript: */
@elishowk
elishowk / .jshintrc
Created October 30, 2012 09:33
.jshintrc
{
"node": true,
"es5": true,
"esnext": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"latedef": true,