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 re | |
from textwrap import indent, fill | |
def dict_words(): | |
"""ALL THE WORDS!!1""" | |
re_dict_words = r"^[a-z]{4,}$" | |
with open("/usr/share/dict/words") as words_file: | |
content = words_file.read() # .lower() |
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 backoff(test_func, reason=None): | |
def decorator(func): | |
@wraps(func) | |
def inner(*args, **kwargs): | |
if test_func(*args, **kwargs): | |
return None | |
result = None | |
for wait_secs in [0, 1, 4, 9, 16, 32, 64, 128, 256, None]: | |
result = func(*args, **kwargs) |
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 bash | |
# | |
# Usage: | |
# Copy to your /usr/share/git-core/templates/hooks directory, | |
# and to any existing git repos. | |
# | |
# Copy to existing git repos (except those with existing 'commit-msg'): | |
# find $HOME -name '.git' -type d -exec test '!' -e "{}/hooks/commit-msg" ';' \ | |
# -exec cp /usr/share/git-core/templates/hooks/commit-msg "{}/hooks" ';' | |
# |
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 bash | |
# | |
# Usage: | |
# Personalize: WORK_DIR, WORK_EMAIL, PUBLIC_EMAIL, etc. | |
# Copy to your /usr/share/git-core/templates/hooks directory, | |
# and to any existing git repos. | |
# | |
# Unset user.{name,email} | |
# git config --global --unset user.name | |
# git config --global --unset user.email |
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 inspect | |
import pytest | |
def pytest_addhooks(pluginmanager): | |
print(inspect.currentframe().f_code.co_name) | |
def pytest_namespace(): |
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
# Repro "unknown" issue with GeckoDriver and Firefox 48+ | |
# Setup Details: | |
# Firefox 50.1.0 | |
# | |
# Selenium Server Standalone v3.0.1 | |
# GeckoDriver 0.12.0 | |
# | |
# Python 2.7.12 | |
# pip freeze: |
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 ruby | |
# gem: gem install json_cat | |
# project: https://github.com/sanscore/json_cat | |
# rubygems: https://rubygems.org/gems/json_cat | |
require 'time' | |
require 'json' | |
require 'optparse' | |
require 'rainbow' |