Skip to content

Instantly share code, notes, and snippets.

View pagles's full-sized avatar

Yorgos Pagles pagles

View GitHub Profile
@pagles
pagles / gist:3888616
Created October 14, 2012 13:35
flake8 and flymake integration
;; flake8 and flymake integration
(when (load "flymake" t)
(defun flymake-flake8-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "flake8" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
@pagles
pagles / es.sh
Created February 29, 2012 18:23 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
cd ~
sudo apt-get install unzip
sudo apt-get install python-software-properties -y
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.0.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
@pagles
pagles / gist:1097127
Created July 21, 2011 12:56 — forked from shun115/gist:789529
Python : pythonbrew + virtualenv 環境の構築
$ curl -kLO https://github.com/utahta/pythonbrew/raw/master/pythonbrew-install
$ chmod +x pythonbrew-install
$ ./pythonbrew-install
$ echo "source ~/.pythonbrew/etc/bashrc" >> .bashrc
$ source .bashrc
$ pythonbrew install -f 2.6.6 # なぜかtest_ioctlでこけたためforce
$ pythonbrew install -f 3.1.3 # 同上
$ pythonbrew switch 2.6.6
@pagles
pagles / check_versions.py
Created July 6, 2011 08:56 — forked from coordt/check_versions.py
Show local, remote and current versions of installed packages using Fabric
from __future__ import with_statement
from fabric.api import env, run, settings, hide, local
from fabric.decorators import hosts, runs_once
import os
import pip
import sys, xmlrpclib
from cStringIO import StringIO
from distutils.version import StrictVersion, LooseVersion
def _find_current_version(package, index_urls=None):
@pagles
pagles / admin.py
Created June 17, 2011 13:17 — forked from dokterbob/admin.py
InlineAdmin mixin limiting the selection of related items according to criteria which can depend on the current parent object being edited.
class LimitedAdminInlineMixin(object):
"""
InlineAdmin mixin limiting the selection of related items according to
criteria which can depend on the current parent object being edited.
A typical use case would be selecting a subset of related items from
other inlines, ie. images, to have some relation to other inlines.
Use as follows::
@pagles
pagles / gist:1005962
Created June 3, 2011 06:34
Using django taggit with custom tags
class MyTag(TagBase):
def slugify(self, tag, i=None):
slug = slughifi(tag)
if i is not None:
slug += "_%d" % i
return slug
class Meta:
verbose_name = _("Tag")
@pagles
pagles / gist:734655
Created December 9, 2010 12:10 — forked from idan/gist:723316
<!doctype html>
<html>
<head>
<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
<script src="js/modernizr-1.6.min.js"></script>
<!--
Typekit needs to happen inside the HEAD, but below CSS, else we get the FOUT
http://www.stevesouders.com/blog/2009/10/13/font-face-and-performance/
-->
{% block typekit %}
@pagles
pagles / fabfile.py
Created December 9, 2010 12:09 — forked from coordt/fabfile.py
from __future__ import with_statement
from fabric.api import env, run, settings, hide
from fabric.decorators import hosts, runs_once
venv = "/home/websites/.virtualenvs/twtv3/"
env.user = 'webdev'
env.hosts = [
'192.168.1.10',
'192.168.1.11',
@pagles
pagles / site.py
Created November 12, 2010 09:42 — forked from fiee/site.py
# -*- coding: utf-8 -*-
"""
Extension for FeinCMS Page
"""
from django.conf import settings
from django.db import models
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager
from django.utils.translation import ugettext_lazy as _
from feincms.module.page.models import Page, PageManager
/*
* This is a modified version of the ck editor integration from the public
* domain source in http://www.sencha.com/forum/showthread.php?79031.
*
* Fixed issues when loading multiple editors in multiple TabPanels, wrong calls
* to the superclass methods.
*/
Ext.namespace("Ext.ux.form");