Skip to content

Instantly share code, notes, and snippets.

View pije76's full-sized avatar

panjianom pije76

View GitHub Profile
@pije76
pije76 / multi_contact_form.py
Created October 24, 2012 09:02 — forked from mjtamlyn/multi_contact_form.py
Multi-contact form (FeinCMS content type)
from django.db import models
from django.utils.text import ugettext_lazy as _
from .contact_form_amended import ContactForm, ContactFormContent
class MultiContactFormContent(ContactFormContent):
FORM_CLASSES = {'simple-contact': ContactForm}
FORM_CHOICES = (('simple-contact', _('Simple contact form')),)
@pije76
pije76 / settings.py
Created October 24, 2012 06:22
ElephantBlog Config - 2
########## ELEPHANTBLOG CONFIGURATION
def elephantblog_entry_url_app(self):
from feincms.content.application.models import app_reverse
return app_reverse('elephantblog_entry_detail', 'elephantblog.urls', kwargs={
'year': self.published_on.strftime('%Y'),
'month': self.published_on.strftime('%m'),
'day': self.published_on.strftime('%d'),
'slug': self.slug,
})
@pije76
pije76 / applicationcontentconfig.py
Created October 24, 2012 06:21
ElephantBlog Config
Page.create_content_type(ApplicationContent, APPLICATIONS=(
('elephantblog.urls', _('Blog')),
))
@pije76
pije76 / class2go.wsgi
Created October 22, 2012 21:30 — forked from nveid/class2go.wsgi
class2go.wsgi
import os, sys
import site
# Remember original sys.path.
prev_sys_path = list(sys.path)
# we add currently directory to path and change to it
pwd = os.path.dirname(os.path.abspath(__file__))
os.chdir(pwd)
sys.path = [pwd] + sys.path
@pije76
pije76 / dreamhost_python_setup.sh
Created October 20, 2012 19:49 — forked from wting/dreamhost_python_setup.sh
Dreamhost Python Setup script
#!/usr/bin/env bash
# Written by William Ting for the following blog post:
# http://williamting.com/posts/2012/04/18/set-up-python-and-django-on-dreamhost/
rcfile="${HOME}/.bashrc"
version="2.7.3"
setuptools_version="2.7"
tmp_dir="${HOME}/tmp-${RANDOM}"
if [[ ${#} == 0 ]]; then
<?php
// This is a sample PHP script that demonstrates accepting a POST from the
// Unbounce form submission webhook, and then sending an email notification.
function stripslashes_deep($value) {
$value = is_array($value) ?
array_map('stripslashes_deep', $value) :
stripslashes($value);
return $value;
}