Skip to content

Instantly share code, notes, and snippets.

View svetlyak40wt's full-sized avatar
💭
Making Ultralisp.org

Alexander Artemenko svetlyak40wt

💭
Making Ultralisp.org
View GitHub Profile
@burtonsamograd
burtonsamograd / save-lisp-tree-shake-and-die.lisp
Last active February 11, 2024 20:33
A quick and dirty tree shaker for SBCL, giving about a 40% reduction in dump size.
;; -*- mode: lisp -*-
;;
;; A quick and dirty tree shaker for SBCL. Basically, it destroys the
;; package system and does a gc before saving the lisp image. Gives
;; about a 40% reduction in image size on a basic hello world test.
;; Would like to hear how it works on larger projects.
;;
;; Original idea from: https://groups.google.com/d/msg/comp.lang.lisp/6zpZsWFFW18/WMy4PyA9B4kJ
;;
;; Burton Samograd
@beshkenadze
beshkenadze / ace_markdown.url
Created January 31, 2014 09:55
ace editor on page markdown
data:text/html;base64,PHN0eWxlIHR5cGU9InRleHQvY3NzIj4uZXtwb3NpdGlvbjphYnNvbHV0ZTt0b3A6MDtyaWdodDowO2JvdHRvbTowO2xlZnQ6MDt9PC9zdHlsZT48ZGl2IGNsYXNzPSJlIiBpZD0iZWRpdG9yIj48L2Rpdj48c2NyaXB0IHNyYz0iaHR0cDovL2QxbjB4M3FqaTgyejUzLmNsb3VkZnJvbnQubmV0L3NyYy1taW4tbm9jb25mbGljdC9hY2UuanMiIHR5cGU9InRleHQvamF2YXNjcmlwdCIgY2hhcnNldD0idXRmLTgiPjwvc2NyaXB0PjxzY3JpcHQ+dmFyIGU9YWNlLmVkaXQoImVkaXRvciIpO2Uuc2V0VGhlbWUoImFjZS90aGVtZS90d2lsaWdodCIpO2UuZ2V0U2Vzc2lvbigpLnNldE1vZGUoImFjZS9tb2RlL21hcmtkb3duIik7PC9zY3JpcHQ+
@martialboniou
martialboniou / gist:1485836
Created December 16, 2011 12:18
sbcl easy install
#!/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 December 4, 2010 17:07
A script to build Django from the given SVN revision.
#!/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
# 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 = []
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 08:17
How to set python logging with comprehensive format.
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 July 28, 2009 10:51
Firefox cookies saver
#!/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 07:59
Little helper, to access ElementTree nodes as attributes.
#########################################################
# 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."""