Skip to content

Instantly share code, notes, and snippets.

View pigeonflight's full-sized avatar

David Bain pigeonflight

View GitHub Profile
@pigeonflight
pigeonflight / README
Created April 28, 2011 21:19
Still Testing Gists
This is just my way of testing gists
@pigeonflight
pigeonflight / convert_news_to_press.py
Created May 3, 2011 13:08
A Zope Python Script that converts a Plone News Item to a Press Release
## Script (Python) "convert_news_to_press"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Convert to News Items to Press Releases
##
source_contenttype = 'News Item'
@pigeonflight
pigeonflight / top10plonedevtips.rst
Created May 5, 2011 14:37
My Top 10 Plone Notes/Tips/Tricks for Developers
@pigeonflight
pigeonflight / configure.zcml
Created June 13, 2011 13:21
Hello World Browser View Example
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="your.product">
<!-- this is browser/configure.zcml
without the allowed_attributes I get a permission error -->
<browser:page
name="helloview"
for="*"
@pigeonflight
pigeonflight / buildout.cfg
Created December 31, 2011 13:23
Plone WSGI Buildout
[buildout]
extensions =
buildout.bootstrap
mr.developer
extends = http://dist.plone.org/release/4.2b1/versions.cfg
extends-cache = .
find-links = http://dist.plone.org/thirdparty/elementtree-1.2.7-20070827-preview.zip
parts =
mod-wsgi
plone
@pigeonflight
pigeonflight / plonewsgi.sh
Created December 31, 2011 13:33
install plone to run on wsgi
mkdir plonewsgi
cd plonewsgi
# works with python 2.7 virtualenv!!
virtualenv-2.7 --no-site-packages --distribute .
bin/pip install zc.buildout
bin/buildout init
wget --no-check-certificate https://raw.github.com/gist/1543998/34af3ad5cffe1df2f6c4253bc771de6bb3760857/buildout.cfg
bin/buildout
#to start your plone instance run
@pigeonflight
pigeonflight / ploneide.sh
Created January 7, 2012 22:44
Quick Installation of Ploneide
wget http://dl.dropbox.com/u/1004432/ploneide.zip
# on OS X use
# curl -O http://dl.dropbox.com/u/1004432/ploneide.zip
unzip ploneide.zip
cd ploneide
python2.6 bootstrap.py
bin/buildout
# be sure you have reliable internet access
# wait 15 - 25 minutes
# TROUBLESHOOTING
# add these lines to your script so that it will become proxy aware
# it assumes that you have set an http_proxy and or https_proxy
# export http_proxy=myproxy:8080
# export https_proxy=myproxy:8080
opener = urllib2.build_opener()
urllib2.install_opener(opener)
@pigeonflight
pigeonflight / gdataspreadsheet.py
Created April 11, 2012 12:54
gdata api example
""" This script allows you to interactively create a new database """
import gdata.spreadsheet.text_db
import getpass
import os
# os.putenv('http_proxy','scalpel:8080')
# os.putenv('https_proxy','scalpel:8080')
# Create a client class which will make HTTP requests with
# Google Spreadsheet Service
@pigeonflight
pigeonflight / processingthing
Created April 30, 2012 17:40
my processing thing
/**
* Subtractive Color Wheel
* by Ira Greenberg.
*
* The primaries are red, yellow, and blue. The secondaries are green,
* purple, and orange. The tertiaries are yellow-orange, red-orange,
* red-purple, blue-purple, blue-green, and yellow-green.
*
* Create a shade or tint of the subtractive color wheel using
* SHADE or TINT parameters.