Skip to content

Instantly share code, notes, and snippets.

View digicase's full-sized avatar

Arthur Case digicase

  • Studio Automatique
View GitHub Profile
@albertsun
albertsun / linebreaks_wp.py
Created August 21, 2011 05:44
Python port of WordPress's wpautop filter
import re
from django import template
from django.utils.functional import allow_lazy
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe, SafeData
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.text import normalize_newlines
register = template.Library()
@dreamiurg
dreamiurg / fabfile.py
Created July 25, 2011 08:40
fabfile.py for webfaction and vagrant
"""
This fabric file makes setting up and deploying a django application much
easier to webfaction servers or your dedicated server, but it does make a
few assumptions. Namely that you're using Git, Apache and mod_wsgi. Also
you should have SSH installed on both the local machine and any servers you
want to deploy to.
Thanks to:
http://github.com/ryanmark/django-project-templates
@jimeh
jimeh / show-and-hide-any-app.applescript
Created June 8, 2011 00:45
AppleScript to help make any app toggle-able via a global hotkeys like the Twitter and Sparrow apps.
-----------------------------------------
-- Show and Hide <application>
-----------------------------------------
--
-- This script allows you to easily
-- toggle the visibility of a specific
-- app, similar to how Twitter and
-- Sparrow toggle with their global
-- hotkey option.
--
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
@stefanfoulis
stefanfoulis / osx_developer_installation.rst
Last active April 14, 2025 05:03
Instructions on how to setup an OSX developer machine for (python/django) development

OSX Developer System installation

This guide assumes a fresh install of Mac OSX 10.7 Lion.

Brew User

@protocool
protocool / caveatPatchor.js
Created February 14, 2011 02:29
Sample caveatPatchor.js file for use in Propane 1.1.2 and above
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@mrflip
mrflip / gist:766608
Created January 5, 2011 17:15
Elasticsearch shell config
We couldn’t find that file to show.
  1. Open Photoshop > Preferences > Guides, Grid, Slices & Count...
  2. In the Grid section, set: Gridline every 10 pixels, subdivisions 10.
  3. Make sure View > Show > Grid is or -. It seems to be a bug in photoshop, but snapping to grid doesn't work when the grid is enabled but hidden. If you find the grid distracting, you can set it to "Dots" in prefs.
  4. Make sure View > Snap is .
  5. Make sure View > Snap To > Grid is .

Now, if you show extras (that's View > Extras or Cmd-H or maybe Cmd-Ctrl-H) everything will snap to pixel boundaries. If you hide extras, some tools will work subpixel.

Note: I run CS3 so I don't know if this still works on CS4 or CS5. It probably does.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cross-browser kerning-pairs & ligatures</title>
<style>
body { font-family: sans-serif; background: #f4f3f3; color: rgba(40, 30, 0, 1); width: 500px; margin: 80px auto; padding: 0px; }
a { color: rgba(15, 10, 0, 0.8); text-decoration: none; border-bottom: 1px solid; padding: 1px 1px 0px; -webkit-transition: background 1s ease; }
a:hover { background: rgba(0, 220, 220, 0.2); }
p, li { line-height: 1.5; padding: 0em 1em 0em 0em; margin: 0em 0em 0.5em; }
@robflaherty
robflaherty / nginx-0765-installer.txt
Created February 19, 2010 00:39
Nginx 0.7.65 installer for Webfaction
-----BEGIN WEBFACTION INSTALL SCRIPT-----
#!/bin/env python2.4
"""
Nginx 0.7.65 Installer New
"autostart": not applicable
"extra info": Enter domain name for the nginx app
"""