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 python3 | |
import sys | |
import socket | |
import select | |
def command(name, args=None): | |
return {'name': name, 'args': args} | |
def readcmd(): |
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
from nonlocal_ import nonlocal_ | |
def foo(): | |
a = 1 | |
def bar(): | |
nonlocal_('a') | |
a = 2 | |
bar() | |
return a |
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
Section "Device" | |
Identifier "VNC Device" | |
Driver "vesa" | |
EndSection | |
Section "Screen" | |
Identifier "VNC Screen" | |
Device "VNC Device" | |
Monitor "VNC Monitor" | |
SubSection "Display" |
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 | |
# | |
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. | |
# | |
# Permission to use, copy, modify, and distribute this software and its | |
# documentation for any purpose and without fee is hereby granted, | |
# provided that the above copyright notice appear in all copies and that | |
# both that copyright notice and this permission notice appear in | |
# supporting documentation, and that the name of Vinay Sajip | |
# not be used in advertising or publicity pertaining to distribution |
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
from collections import Counter | |
import logging | |
from pprint import pprint | |
import sys | |
import caniusepython3 | |
from caniusepython3.dependencies import blocking_dependencies | |
logger = logging.getLogger(__name__) |
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
--- C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.txt | |
+++ C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat | |
@@ -16,23 +16,23 @@ | |
goto :eof | |
:amd64 | |
-if not exist "%~dp0bin\amd64\vcvarsamd64.bat" goto missing | |
-call "%~dp0bin\amd64\vcvarsamd64.bat" | |
+if not exist "%~dp0bin\vcvars64.bat" goto missing | |
+call "%~dp0bin\vcvars64.bat" |
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
# | |
# Copyright 2009 Vinay Sajip | |
# | |
import logging | |
logger = logging.getLogger(__name__) | |
class LogWriter: | |
def __init__(self, logger): | |
self.logger = logger |
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 logging.handlers | |
import smtplib | |
class BufferingSMTPHandler(logging.handlers.BufferingHandler): | |
def __init__(self, mailhost, fromaddr, toaddrs, subject, capacity): | |
logging.handlers.BufferingHandler.__init__(self, capacity) | |
self.mailhost = mailhost | |
self.mailport = None | |
self.fromaddr = fromaddr | |
if isinstance(toaddrs, (str, unicode)): |
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
# | |
# Copyright (C) 2009 Vinay Sajip. | |
# Licensed under the PSF licence. | |
# Exploratory code to convert %-format strings to {}-format. | |
# | |
import re | |
PATTERN = re.compile(r''' | |
% # specifier start |
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
<!DOCTYPE html> | |
<title>Example graph</title> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; | |
width: 960px; | |
height: 500px; | |
position: relative; |
OlderNewer