This file contains hidden or 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 Testing import makerequest | |
root = makerequest.makerequest(app) | |
site = root.mysite | |
folder = site.myfolder['some-folder'] | |
admin = root.acl_users.getUserById('admin') | |
admin = admin.__of__(site.acl_users) | |
from AccessControl.SecurityManagement import newSecurityManager | |
newSecurityManager(None, admin) |
This file contains hidden or 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 dircolors, a utility to help you set the | |
# LS_COLORS environment variable used by GNU ls with the --color option. | |
# Copyright (C) 1996, 1999-2011 Free Software Foundation, Inc. | |
# Copying and distribution of this file, with or without modification, | |
# are permitted provided the copyright notice and this notice are preserved. | |
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the | |
# slackware version of dircolors) are recognized but ignored. | |
# Below, there should be one TERM entry for each termtype that is colorizable | |
TERM Eterm | |
TERM ansi |
This file contains hidden or 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 bs4 import BeautifulSoup | |
import requests | |
r = requests.get("http://www.nasdaq.com/symbol/f/dividend-history") | |
data = r.content | |
soup = BeautifulSoup(data) | |
for i in range(1,31): | |
id_exdate = "#quotes_content_left_dividendhistoryGrid_exdate_"+str(i) | |
id_cash = "#quotes_content_left_dividendhistoryGrid_CashAmount_"+str(i) | |
id_decl = "#quotes_content_left_dividendhistoryGrid_DeclDate_"+str(i) | |
id_rec = "#quotes_content_left_dividendhistoryGrid_RecDate_"+str(i) |
This file contains hidden or 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
# !/usr/bin/python | |
# -*- coding: gbk -*- | |
# http://hi.baidu.com/xiaopch/item/3a54eec3d93f9e2def466548 | |
from __future__ import division | |
import os | |
import codecs | |
import nltk | |
from nltk import * | |
##from nltk.book import * |
This file contains hidden or 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 | |
request = container.REQUEST | |
catalog = getToolByName(context, 'portal_catalog') | |
path = '/mysite/temples' | |
for brain in catalog(portal_type='Temple', path=path): | |
try: | |
obj = brain.getObject() | |
print brain.getPath().split('/')[5] + ', ' + brain['Title'] + ', ' + obj.getEra() | |
except: |
This file contains hidden or 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
import os | |
import sys | |
import pyExcelerator | |
from pyExcelerator import * | |
import xlrd | |
from database import PGDatabase | |
mydb = PGDatabase() | |
#mydb = mydbC.connect() |
This file contains hidden or 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
################################################################# | |
# | |
# Development Configuration | |
# ========================= | |
# | |
# This is a buildout configuration that sets up a development | |
# environment for Plone. It extends buildout.cfg. | |
# | |
# To use this configuration, run buildout via: | |
# |
This file contains hidden or 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 www-data; | |
worker_processes 4; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} | |
http { |
This file contains hidden or 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
/* For devices with narrow screens, phones, tablets, etc. */ | |
#portal-column-one, | |
#portal-column-two, | |
#portal-column-content, | |
#portal-column { /* updated */ | |
clear: both; | |
width: 97.75%; | |
margin-left: -98.875%; | |
} |
This file contains hidden or 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
#!/bin/sh | |
# This assumes you installed Plone on Nitrous.io using these instructions | |
# http://blog.dbain.com/2013/07/plone-quickstart-on-cloud-in-less-than.html | |
# download this file and run it with the following command | |
# sh plone-builddev.sh | |
echo "running buildout with default buildout.cfg" | |
~/plone433/zinstance/bin/buildout -c ~/plone433/zinstance/develop.cfg |