This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/code$ hg clone git://github.com/dirceu/emacs-starter-kit.git dirceu-emacs-starter-kit | |
fetching from : origin | |
importing Hg objects into Git | |
Counting objects: 1301, done. | |
Compressing objects: 100% (826/826), done. | |
Total 1301 (delta 485), reused 1242 (delta 452) | |
importing Git objects into Hg | |
at: 0/159 | |
at: 100/159 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This is a buildout configuration for plone 2.5 + interlegis.sqlalchemystorage | |
# | |
[buildout] | |
parts = | |
plone | |
zope2 | |
productdistros | |
instance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Products.CMFCore.utils import getToolByName | |
from zLOG import LOG, INFO | |
def testOwnerInAclUsers(self): | |
portal = getToolByName(self, 'portal_url').getPortalObject() | |
# FIXME: pegar a lista abaixo programaticamente | |
zope_users = [] # lista de usuários no acl_users *do Zope* | |
plone_users = map(str, portal.acl_users.getUsers()) | |
users = zope_users + plone_users | |
def inner_function(obj, path): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby ruby1.8-dev build-essential libmysql-ruby mysql-server libmysqlclient15-dev | |
cd /tmp | |
wget "http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz" | |
tar -xvzf rubygems-1.3.1.tgz | |
rm rubygems-1.3.1.tgz | |
cd rubygems-1.3.1 | |
sudo ruby setup.rb | |
cd .. | |
rm -r rubygems-1.3.1 | |
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Opções de boot para o CCE W93 | |
noapic nolapic nobluetooth pci=assign-busses apicmaintimer idle=poll reboot=cold,hard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.yml | |
twitter.xml | |
last_id.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following code can be used to delete an object that is return POSKeyErrors | |
# on a ZODB database. Run it using 'zopectl debug'. Tested with Zope 2.9. | |
container_id = '/path/to/container' | |
screwed_object_id = 'screwed_obj' | |
from ZODB.POSException import POSKeyError | |
import transaction | |
obj = app.unrestrictedTraverse(container_id) | |
obj._objects = tuple(filter(lambda i,n = id: i['id'] != n, obj._objects)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ tree > t | |
$ python repeated_files_on_tree.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ATSAObjectField_get(self, instance, **kwargs): | |
__traceback_info__ = (self.getName(), instance, kwargs) | |
storage = self.getStorage(instance) | |
original_storage = config.storages.get(instance.__class__.__name__ + self.getName(), None) | |
if original_storage: | |
storage = original_storage | |
try: | |
kwargs['field'] = self | |
r = storage.get(self.getName(), instance, **kwargs) | |
except AttributeError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from StringIO import StringIO | |
from Products.CMFCore.utils import getToolByName | |
from zope.app.component.hooks import setSite | |
from zope.app.component.interfaces import ISite, IPossibleSite | |
from Products.Five.site.localsite import enableLocalSiteHook | |
from collective.lead.interfaces import IDatabase |