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 python | |
import threading | |
def handleSigint(*args): | |
print 'Received SIGINT. Notifying worker threads to stop.', args | |
global shutdown | |
shutdown = True | |
shutdown = False |
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 python3 | |
import sys | |
import subprocess | |
with open(sys.argv[1], 'r+') as commit_message_file: | |
commit_message = list(commit_message_file) | |
for line in commit_message: | |
line = line.strip() |
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
# "Understanding Python's closures". | |
# | |
# Tested in Python 3.1.2 | |
# | |
# General points: | |
# | |
# 1. Closured lexical environments are stored | |
# in the property __closure__ of a function | |
# | |
# 2. If a function does not use free variables |
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 python3 | |
""" | |
A pure Python "ping" implementation, based on a rewrite by Johannes Meyer, | |
of a script originally by Matthew Dixon Cowles. Which in turn was derived | |
from "ping.c", distributed in Linux's netkit. The version this was forked | |
out of can be found here: https://gist.github.com/pklaus/856268 | |
I've rewritten nearly everything for enhanced performance and readability, | |
and removed unnecessary functions (assynchroneous PingQuery and related). |
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 python3 | |
import subprocess | |
print('Fetching remote branches...') | |
subprocess.call('git fetch -p --all', shell=True) | |
print('Processing remote branches...') | |
remote_branches = subprocess.check_output( |
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
# Make test method names str more friendly for feeding them to ./manage.py test | |
unittest.case.TestCase.__str__ = lambda self: \ | |
f'{self.__class__.__module__}.{self.__class__.__qualname__}.{self._testMethodName}' |
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 time | |
import math | |
import pygame | |
WIDTH = 320 # width of screen | |
HEIGHT = 240 # height of screen | |
FPS = 30 # frames per second setting |
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
root@4f2af8100e1f:# strings /proc/1/environ | |
PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
HOSTNAME=4f2af8100e1f | |
COMPUTERNAME=10-30-0-24 | |
PLATFORM_VERSION=97.0.7.610 | |
APPSVC_RUN_ZIP=FALSE | |
WEBSITE_SKU=LinuxFree | |
... | |
------------------------------------------------------------------------------- |
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 functools | |
import logging.config | |
import mongoengine | |
import pydantic as p | |
logging.basicConfig() | |
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
""" | |
This application will calculate the chop saw miter and bevel settings for any angle crown molding. | |
https://play.google.com/store/apps/details?id=com.crownking | |
""" | |
import math | |
wall_angle = 90 # Wall angle | |
sping_angle = 38 # Miter spring angle | |
sa2 = math.radians(sping_angle) |
OlderNewer