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
# Configuration file for nginx | |
# | |
# This file must me symlinked to /etc/nginx/sites-enabled/default | |
upstream plone { | |
server localhost:8081; | |
server localhost:8082; | |
} | |
server { |
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
# Configuration file for nginx | |
# | |
# This file must me symlinked to /etc/nginx/nginx.conf | |
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 4096; |
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
# VCL configuration file for Varnish. It defines 2 backends, one for | |
# each Plone instance, and uses hash load balancing. | |
# | |
# This file must me symlinked to /etc/varnish/default.vcl | |
vcl 4.0; | |
import directors; | |
import std; |
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
# Configuration file for varnish | |
# | |
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK | |
# to be set from this shell script fragment. | |
# | |
# This file should be symlinked to /etc/default/varnish | |
# Should we start varnishd at boot? Set to "no" to disable. | |
START=yes |
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 plone import api | |
from zope.component.hooks import setSite | |
import transaction | |
def spoof_request(app): | |
from AccessControl.SecurityManagement import newSecurityManager | |
from AccessControl.SecurityManager import setSecurityPolicy | |
from Testing.makerequest import makerequest |
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 -*- | |
"""Hacks to work around API inconsistencies between Archetypes and Dexterity.""" | |
def set_image_field(obj, image, content_type): | |
"""Set image field in object on both, Archetypes and Dexterity.""" | |
from plone.namedfile.file import NamedBlobImage | |
try: | |
obj.setImage(image) # Archetypes | |
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
eggs += bpython | |
bin/instance debug | |
import bpython; bpython.embed(locals_=locals()) | |
eggs += IPython | |
bin/instance debug |
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
[buildout] | |
parts = pep257 | |
[pep257] | |
recipe = zc.recipe.egg | |
eggs = pep257 | |
entry-points = pep257=pep257:main | |
arguments = *pep257.parse_options() |
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
>>> user, password = 'hvelarde', 'password' | |
>>> from github3 import login | |
>>> g = login(user, password=password) | |
>>> o = g.organization('collective') | |
>>> g.ratelimit_remaining | |
3369 | |
>>> my_stats = [] | |
>>> for r in o.iter_repos(): | |
... for c in r.iter_contributor_statistics(): | |
... if user in repr(c.author): |
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
(python-2.7)# hvelarde@nanovac (master u=) ~/collective/cover | |
# git shortlog -s | sort -nr | |
697 hvelarde | |
312 Juan Pablo Giménez | |
91 Héctor Velarde | |
78 Franco Pellegrini | |
76 Marcos F. Romero | |
71 quimera | |
71 Cleber J Santos | |
66 Gonzalo Almeida |