Skip to content

Instantly share code, notes, and snippets.

@schlamar
schlamar / processify.py
Last active April 17, 2024 19:19
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value
@dbarnett
dbarnett / jsonalchemy.py
Created February 3, 2012 15:10
JSONAlchemy: Proper JSON marshalling and mutation tracking in SQLAlchemy
import simplejson
import sqlalchemy
from sqlalchemy import String
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String
@krestenkrab
krestenkrab / hindent.el
Created December 22, 2011 14:14
hindent.el: Highlight indentation of current line
;;;
;;; Copyright (C) Kresten Krab Thorup
;;; Available under Apache License, Version 2.
;;;
;;;
;;; This minor mode will highlight the indentation of the current line
;;; as a vertical bar (grey background color) aligned with the column of the
;;; first character of the current line.
;;;