Skip to content

Instantly share code, notes, and snippets.

View gijs's full-sized avatar

Gijs Nijholt gijs

View GitHub Profile
@gijs
gijs / gist:2131
Created July 24, 2008 12:56
Testing gist
urlpatterns += patterns('project.website.views',
url(r'^client/$', 'client', name='client'),
url(r'^signin/$', 'signin', name='signin'),
url(r'^signout/$', 'signout', name='signout'),
url(r'^zoeken/$', 'search', name='search'),
url(r'^(?P<slug>.*)/(?P<subslug>.*)/$', 'subpage', name='subpage'),
url(r'^(?P<slug>.*)/$', 'page', name='page'),
url(r'^$', 'index', name='homepage'),
)
@gijs
gijs / gist:9853
Created September 10, 2008 09:15
def getxml(request):
"""docstring for getxml"""
"""
<vars>
<prices type="array">
<price count="0" type="int">0</price>
<price count="1" type="int">1</price>
<price count="2" type="int">2</price>
<price count="3" type="int">3</price>
<price count="4" type="int">4</price>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>test</title>
<style>
div#bubble{
width: 200px;
views.py:
----------
def index(request):
plannings = Planning.objects.order_by('time_start').filter(user=request.user)
cal_source = PlanningCalendar(plannings)
cal = cal_source.formatmonth(datetime.now().year, datetime.now().month)
return render_to_response("planning/index.html", locals(), context_instance=RequestContext(request))
----------
index.html
<VirtualHost *:80>
ServerName www.domain1.nl
ServerAdmin gijs@domain1.nl
DocumentRoot /var/www/
WSGIDaemonProcess www.domain1.nl processes=2 threads=10
WSGIProcessGroup www.domain1.nl
#WSGIApplicationGroup %{GLOBAL}
<?php
// $Id$
/**
* Implement hook_schema().
*/
function relation_schema() {
$schema['relation_allowed'] = array(
'description' => 'Table for storing permitted relations between content types',
$form['buttons']['submit'] = array(
'#type' => 'submit',
'#value' => t('Save configuration'),
'#?????????' => 'my_custom_handler',
);
import operator
from django.db import models
from django.http import HttpResponse, HttpResponseNotFound
from django.db.models.query import QuerySet
from django.utils.encoding import smart_str
from django.contrib import admin
from django.conf.urls.defaults import *
from autocomplete_admin import *
from filmdb.models import *
.mouse{
position: absolute;
background-image: url('../images/cursor.png');
width: 15px;
height: 22px;
z-index: 100;
}
(function () {
try{
if(!google.doodle)google.doodle = {};
var a = 200, g = -200, j = -200, k, l, m, n = 0, o = 0, p = 0, q = 35, r, s = [], t, u, v;
google.doodle.init = function () {
if(!v&&window.location.href.indexOf("#") = = -1){
v = true;
if(t = document.getElementById("hplogo")){
google.j&&google.j.en&&w(100, x, function () {
return google.rein&&google.dstr});