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
import time | |
import logging | |
class Timer: | |
""" | |
A Timer helper | |
This object can be used as an object, context or decorator. | |
Messages can be collected via logging by using the report() method. |
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
javascript:(function(){prompt("short url", window.location.href.replace(/^(.*:\/\/[^\/]+).*\/(dp|gp\/product)\/([^\/]+).*/, "$1/dp/$3"))})() |
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
""" Test for drawing base64 image strings for job progress | |
Example Job: | |
{ | |
'comment': '', | |
'maxslots': 0, | |
'numblocked': 0, | |
'spoolcwd': '/home/freddie/unitard, | |
'numerror': 0, | |
'aftertime': None, |
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
""" Add the QWebEngineView | |
Requires Qt.py >=1.1.0 | |
""" | |
import logging | |
LOG = logging.getLogger('tx.QtSiteConfig') | |
def update_members(members): | |
LOG.debug("update_members") | |
members['QtWebEngineWidgets'] = ["QWebEngineView","QWebEnginePage"] |
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
#!/usr/bin/env python | |
import argparse | |
import requests | |
import logging | |
LOG = logging.getLogger("slack_leaver") | |
class JSONRest(object): | |
def __init__(self, base_url): |
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
if [ -r ~/.ssh/known_hosts ]; then | |
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e 's/,.*//g' | uniq | grep -v "\["`;)" ssh | |
fi |
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
# http://docs.thefoundry.co.uk/nuke/63/pythondevguide/flipbook.html | |
# Copyright (c) 2010 The Foundry Visionmongers Ltd. All Rights Reserved. | |
import glob | |
import os.path | |
import platform | |
import re | |
import subprocess | |
import sys | |
import thread |
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
import os | |
import sys | |
import grp | |
import pwd | |
import re | |
import tempfile | |
import shutil | |
import getpass | |
import logging |
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
import sys | |
import getpass | |
sentry_url = 'http://<hash>:<hash>@sentry-server.local/1' | |
try: | |
import raven | |
RAVEN_CLIENT = raven.Client(sentry_url) | |
RAVEN_CLIENT.tags_context({'user':getpass.getuser()}) | |
except: | |
RAVEN_CLIENT = None | |
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
""" | |
Flip slashes in ClipBoard | |
Now using Tk, so it should be cross-platform. | |
http://stackoverflow.com/questions/579687 | |
""" | |
from Tkinter import Tk | |
w = Tk() # create window object | |
w.withdraw() # hide window from view. |
NewerOlder