Skip to content

Instantly share code, notes, and snippets.

View Apkawa's full-sized avatar
🌴
On vacation

Apkawa Apkawa

🌴
On vacation
View GitHub Profile
@trey
trey / gist:66406
Created February 18, 2009 16:35 — forked from kogakure/fabfile.py
Fabric for Django
#!/usr/bin/python
# -*- coding: utf-8 -*-
set(
fab_hosts = ['host.com'],
fab_user = 'user',
server_path = '/home/user/django/apache2/bin',
project_path = '/home/user/django/project',
memcached_ip = 'IP',
memcached_port = 'PORT',
@endolith
endolith / Has weird right-to-left characters.txt
Last active July 17, 2024 12:41
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@vinilios
vinilios / django custom aggregate
Created November 4, 2009 12:11
custom django aggregate
class MyMax(Aggregate):
sql_function = 'CHAR_LENGTH'
"""A base class to make it easy for end users to define their own
custom SQL aggregates.
The subclass should define the following two class properties:
* sql_function - the name of the SQL function to invoke
Optionally, you can define
* sql_template - a format string that is used to compose the
@lukmdo
lukmdo / Django & buildout
Created December 14, 2009 08:56
Django & buildout
======================= buildout.cfg =======================
[buildout]
unzip = true
develop = .
eggs =
ws_ha_transitory
ipython
ipdb
MySQL-Python
docutils
@cyberdelia
cyberdelia / fabfile.py
Created April 3, 2010 14:05
Fabric deploy script with : south migrations, rollback and maintenance page.
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }
@caiges
caiges / Django Apps
Created April 28, 2010 17:15
List of Django Apps
django-mingus
django-ratings
django-ajax-validation
django-google-analytics
django-mailer
@kennydude
kennydude / SimpleDjangoTags.py
Created May 23, 2010 18:04
Extremely Simple Django Template Tags
'''
Extremely Simple Django Template Tags!
'''
from django.template import Library, Node, TemplateSyntaxError, resolve_variable
from django.utils.translation import ugettext as _
register = Library()
class GenericTNode(Node):
def __init__(self, parts):
"""
Flatten a nested list structure.
* Works for nested structures of lists, tuples, generators, or any other iterable.
* Special-cases string types and treats them as non-iterable.
* Is not limited to the system recursion limit.
* Yields items from the structure instead of constructing a new list, and can
work on non-terminating generators.
This is basically a non-recursive version of the following:
@netj
netj / memusg
Last active June 25, 2024 17:39
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@garnaat
garnaat / iam_ec2_example.py
Created September 15, 2010 04:48
Use IAM/boto to provide access to EC2 and S3
"""
IAM boto examples:
In this example we create a group that provides access
to all EC2 and S3 resources and actions and then add a
user to that group.
"""
import boto
#
# First create a connection to the IAM service