Skip to content

Instantly share code, notes, and snippets.

View philippbosch's full-sized avatar

Philipp Bosch philippbosch

View GitHub Profile
@philippbosch
philippbosch / settings.py
Created February 26, 2009 14:37
django project settings templates for django-pb
from distutils.sysconfig import get_python_lib
execfile(get_python_lib() + "/pb/settings_base.py")
read -p "Project name? " PROJECT_NAME
django-admin.py startproject $PROJECT_NAME
mysqladmin5 -uroot --default-character-set=utf8 create $PROJECT_NAME
cd $PROJECT_NAME
chmod +x manage.py
mkdir migrations
mkdir templates
mkdir media
mkdir media/img
mkdir media/css
#!/usr/bin/env python
# encoding: utf-8
"""
twittertrend.py
Created by Philipp Bosch on 2010-03-23.
Copyleft (ɔ) 2010 Philipp Bosch. No rights reserved.
"""
import sys
// Get that document
people.get(me.key, function(r){
console.log(r);
});
// Returns all documents as an array to a callback
people.all(function(r){
console.log(r);
});
...
<input type="text" id="username">
...
<?php
if (preg_match('/Mobile/', $_SERVER['HTTP_USER_AGENT'])) {
header('Location: iphone.html');
exit;
}
?>
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=default-width; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap Device Information</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="jqtouch/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="jqtouch/jqtouch.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js"></script>
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=default-width; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap Notifications</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="jqtouch/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="jqtouch/jqtouch.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js"></script>
//
// UIControls.m
// PhoneGap
//
// Created by Michael Nachbaur on 13/04/09.
// Copyright 2009 Decaf Ninja Software. All rights reserved.
//
#import "UIControls.h"
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
body {
font-family: Helvetica;
}
#elem {