Skip to content

Instantly share code, notes, and snippets.

View amcgregor's full-sized avatar
🏢
Examining Options

Alice Zoë Bevan–McGregor amcgregor

🏢
Examining Options
View GitHub Profile
@amcgregor
amcgregor / development.ini
Created November 15, 2009 11:16
WebCore quickstart INI file template.
[exe]
command = serve
reload = true
[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 8080
[app:main]

This document is a draft. Please be aware that it may change at any time, and some of it is probably on crack, insecure, and may kick your dog.

Data Structure

The on-disk data structure is stored within a self-contained portable MongoDB instance.

Collection Type Description
hosts capped The cache of host IDs, address, and public key. Also includes the private and public keys you generate for each host.
Allows for identity verification during re-connection to recent hosts.
@amcgregor
amcgregor / hello.py
Created November 23, 2009 04:58
Minimal WebCore application.
import web.core
from paste import httpserver
class RootController(web.core.Controller):
def index(self):
return 'Hello world!'
def hello(self, name):
return "Hello, %(name)s!" % dict(name=name)
@amcgregor
amcgregor / wiki.py
Created December 3, 2009 07:16
Compact MongoDB Wiki example.
# encoding: utf8
"""Web application root controller."""
import textile
import pymongo
import web.core
@amcgregor
amcgregor / wiki.html
Created December 3, 2009 07:20
WebCore Wiki HTML template.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>${name}</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
// <![CDATA[
$(function(){
$('#edit').click(function(){
$('.content').empty().append('<form method="post"><textarea name="content"></textarea><input type="submit" name="button" /></form>');
@amcgregor
amcgregor / blog-install.txt
Created January 12, 2010 09:20
WebCore reusable components idea.
1. Download and install WebCore using the boostrap script.
(Optional; skip this if you have an existing environment.)
2. Quickstart a new project.
(Optional; skip this if you have an existing project.)
3. Install WebCore-Blog:
pip install webcore-blog
@amcgregor
amcgregor / install.sh
Created January 27, 2010 08:53
TurboGears installation script.
#!/bin/bash
# This script installs a TurboCMF-viable version of TurboGears and related utilities.
# This... is just dumb. Mostly because of all of the warnings I had to add…
echo "Updating setuptools and installing virtualenv globally."
sudo easy_install -U setuptools
sudo easy_install virtualenv
@amcgregor
amcgregor / root.py
Created February 18, 2010 08:24
The starting root controller for the basic WebCore Wiki example.
# encoding: utf-8
"""Web application root controller."""
import web.core
class RootController(web.core.Controller):
@amcgregor
amcgregor / development-minimal.ini
Created February 18, 2010 08:38
A minimal INI file for the basic WebCore Wiki example.
[server:main]
use = egg:Paste#http
host = 127.0.0.1
port = 8080
[app:main]
use = egg:WebCore
debug = True
web.root = megawiki.controller:RootController
@amcgregor
amcgregor / setup.py
Created February 18, 2010 08:46
The setup.py file for the basic WebCore Wiki example.
#!/usr/bin/env python
import sys, os
from setuptools import setup, find_packages
setup(
name = "MegaWiki",
version = "0.1",
description = "A powerful Wiki example!",
author = "Your Name Here",