Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Making Ultralisp.org

Alexander Artemenko svetlyak40wt

💭
Making Ultralisp.org
View GitHub Profile
@beshkenadze
beshkenadze / ace_markdown.url
Created Jan 31, 2014
ace editor on page markdown
View ace_markdown.url
data:text/html;base64,PHN0eWxlIHR5cGU9InRleHQvY3NzIj4uZXtwb3NpdGlvbjphYnNvbHV0ZTt0b3A6MDtyaWdodDowO2JvdHRvbTowO2xlZnQ6MDt9PC9zdHlsZT48ZGl2IGNsYXNzPSJlIiBpZD0iZWRpdG9yIj48L2Rpdj48c2NyaXB0IHNyYz0iaHR0cDovL2QxbjB4M3FqaTgyejUzLmNsb3VkZnJvbnQubmV0L3NyYy1taW4tbm9jb25mbGljdC9hY2UuanMiIHR5cGU9InRleHQvamF2YXNjcmlwdCIgY2hhcnNldD0idXRmLTgiPjwvc2NyaXB0PjxzY3JpcHQ+dmFyIGU9YWNlLmVkaXQoImVkaXRvciIpO2Uuc2V0VGhlbWUoImFjZS90aGVtZS90d2lsaWdodCIpO2UuZ2V0U2Vzc2lvbigpLnNldE1vZGUoImFjZS9tb2RlL21hcmtkb3duIik7PC9zY3JpcHQ+
View gist:1485836
#!/bin/zsh
BINDIR="${HOME}/.tools/bin"
QUICKLISPDIRNAME=".quicklisp"
WORKINGLISPDIR="${HOME}/Dynamics/sbcl"
EMACS_CL=emacs
() {
[[ -a "${HOME}/.emacs.d/data/.launched" ]]\
&& which emacs-cl > /dev/null 2>&1\
&& EMACS_CL=emacs-cl
}
@svetlyak40wt
svetlyak40wt / build-django.sh
Created Dec 4, 2010
A script to build Django from the given SVN revision.
View build-django.sh
#!/bin/bash
# A script to build Django from the given SVN revision
REV=$1
UPLOAD_TO=locum:www/pypi
pushd .
svn co -r $REV http://code.djangoproject.com/svn/django/trunk/ django-$REV
cd django-$REV
View django_settings_utils.py
# from django.conf import settings
from functools import wraps
class _s:
def __init__(self, a=10, b=None):
self.a, self.b = a,b
def _override_settings(overrides):
_orig = {}
_missing = []
View gist:550438
class QuerySetDoubleIteration(Exception):
"A QuerySet was iterated over twice, you probably want to list() it."
pass
# "Skinny" here means we use iterator by default, rather than
# ballooning in memory.
class SkinnyManager(Manager):
def get_query_set(self):
return SkinnyQuerySet(self.model, using=self._db)
@svetlyak40wt
svetlyak40wt / set_logging.py
Created May 24, 2010
How to set python logging with comprehensive format.
View set_logging.py
import logging
root = logging.getLogger()
handler = logging.FileHandler('debug.log')
fmt = logging.Formatter('%(asctime)s %(process)s/%(thread)s %(levelname)s %(name)s %(filename)s:%(lineno)s %(message)s')
handler.setFormatter(fmt)
root.addHandler(handler)
@svetlyak40wt
svetlyak40wt / export_cookies.py
Created Jul 28, 2009
Firefox cookies saver
View export_cookies.py
#!/usr/bin/env python
# Firefox3 and Chrome cookies converter.
# This script based on another one, from post
# http://blog.schlunzen.org/2008/06/19/firefox-3-und-cookiestxt/
#
# Thanks to:
# dvj@github, for the Chrome support
import optparse
import os
@svetlyak40wt
svetlyak40wt / et_accessor.py
Created May 8, 2009
Little helper, to access ElementTree nodes as attributes.
View et_accessor.py
#########################################################
# Title: Simple ElementTree accessor #
# Author: Alexander Artemenko <svetlyak.40wt@gmail.com> #
# Site: http://aartemenko.com #
# License: New BSD License #
# Original: http://gist.github.com/108704 #
#########################################################
class Accessor(object):
"""Easy to use ElementTree accessor."""
You can’t perform that action at this time.