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 socket | |
# Sauce only tunnels certain ports, so we need to pick one of those ports and it should be | |
# not used. | |
# See port list at: https://saucelabs.com/docs/connect#localhost | |
PORTS = [2000, 2001, 2020, 2222, 3000, 3001, 3030, 3333, 4000, 4001, 4040, 5000, 5001, 5050, 5555, 6000, 6001, 6060, 6666, 7000, 7070, 7777, 8000, 8001, 8080, 8888, 9000, 9001, 9080, 9090, 9999, 4502, 4503, 8003, 8031] | |
def get_free_port(): | |
for port in PORTS: | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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
[ | |
{ | |
"_path": "private", | |
"_type": "ftw.topics.Topic", | |
"title": "Private" | |
}, | |
{ | |
"_path": "private/00054", |
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.Archetypes.interfaces.field import IImageField | |
from plone.app.blob.interfaces import IBlobImageField | |
from ftw.dashboard.portlets.postit.browser import postit | |
from ftw.dashboard.portlets.recentlymodified.browser import recentlymodified | |
from ftw.favorite.portlets import favorites | |
from plone.portlets.interfaces import IPortletManager | |
from zope.component import queryUtility | |
from zope.app.container.interfaces import INameChooser | |
from plone.portlets.constants import USER_CATEGORY | |
from plone.app.portlets.storage import UserPortletAssignmentMapping |
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
# cache of http://download.zope.org/zopetoolkit/index/1.0.8/ztk-versions.cfg | |
[versions] | |
# ZTK | |
zope.annotation = 3.5.0 | |
zope.applicationcontrol = 3.5.5 | |
zope.authentication = 3.7.1 | |
zope.broken = 3.6.0 | |
zope.browser = 1.3 | |
zope.browsermenu = 3.9.1 |
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 memoize import memoize | |
import re | |
import shlex | |
import subprocess | |
def runcmd_get_exitcode(command, cwd=None): | |
return runcmd(command, cwd=cwd)[0] | |
def runcmd_get_stdout(command, cwd=None): |
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 unicodedata | |
def make_sortable(text): | |
"""Converts a string to a sortable string by lowercasing | |
it and removing diacritics. | |
""" | |
if isinstance(text, str): | |
text = text.decode('utf-8') | |
if not isinstance(text, unicode): | |
return text |
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
Debugger entered--Lisp error: (file-error "Cannot open load file" "cl-lib") | |
require(cl-lib) | |
eval-buffer(#<buffer *load*<4>> nil "/Users/jone/projects/cabbage/vendor/magit/magit.el" nil t) ; Reading at buffer position 2337 | |
load-with-code-conversion("/Users/jone/projects/cabbage/vendor/magit/magit.el" "/Users/jone/projects/cabbage/vendor/magit/magit.el" nil t) | |
require(magit) | |
(progn (add-to-list (quote load-path) library-dir) (require library)) | |
(if (and library-dir (file-directory-p library-dir)) (progn (add-to-list (quote load-path) library-dir) (require library))) | |
(when (and library-dir (file-directory-p library-dir)) (add-to-list (quote load-path) library-dir) (require library)) | |
(let* ((library-dir (cabbage-vendor-library-dir library))) (when (and library-dir (file-directory-p library-dir)) (add-to-list (quote load-path) library-dir) (require library))) | |
cabbage-vendor(magit) |
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 unicodedata | |
def strip_diacricits(text): | |
if isinstance(text, str): | |
text = text.decode('utf-8') | |
normalized = unicodedata.normalize('NFKD', text) | |
text = u''.join([c for c in normalized if not unicodedata.combining(c)]) | |
text = text.encode('utf-8') | |
return text |
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
Exception in thread "main" org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@7c6572b | |
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244) | |
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242) | |
at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120) | |
at org.apache.tika.cli.TikaCLI$OutputType.process(TikaCLI.java:141) | |
at org.apache.tika.cli.TikaCLI.process(TikaCLI.java:417) | |
at org.apache.tika.cli.TikaCLI.main(TikaCLI.java:111) | |
Caused by: java.lang.NullPointerException | |
at org.apache.poi.poifs.crypt.Decryptor.hashPassword(Decryptor.java:102) | |
at org.apache.poi.poifs.crypt.AgileDecryptor.verifyPassword(AgileDecryptor.java:66) |
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/env bash | |
set -e | |
oldrev=$1 | |
newrev=$2 | |
run() { | |
[ -x $1 ] && $1 $oldrev $newrev | |
} | |
echo files changed: $(git diff $oldrev $newrev --diff-filter=ACDMR --name-only | wc -l) |