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
# This is a hack to patch slow socket.getfqdn calls that | |
# BaseHTTPServer (and its subclasses) make. | |
# See: http://bugs.python.org/issue6085 | |
# See: http://www.answermysearches.com/xmlrpc-server-slow-in-python-how-to-fix/2140/ | |
import BaseHTTPServer | |
def _bare_address_string(self): | |
host, port = self.client_address[:2] | |
return str(host) |
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
# .screenrc configuration | |
defscrollback 1024 | |
# bind 'b' to copy to clipboard | |
bind b eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'" | |
# turn off start message | |
startup_message off |
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
" .vimrc configuration | |
set nocompatible | |
set autoindent | |
set smartindent | |
set expandtab | |
set tabstop=4 | |
set shiftwidth=4 | |
set showmatch | |
set ruler |
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
rxvt*title: Bash | |
rxvt*background: wheat | |
rxvt*foreground: black | |
rxvt*scrollBar_right: True | |
rxvt*colorBD: 1 | |
rxvt*font: courier | |
rxvt*saveLines: 10000 | |
rxvt*backspacekey: ^? | |
XTerm*saveLines: 5000 |
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 re | |
from django.template.defaultfilters import stringfilter | |
from django import template | |
register = template.Library() | |
YOUTUBE_RE = re.compile(r"^(http://)?(www\.)?(youtube\.com/watch\?v=)?(?P<id>[A-Za-z0-9\-=_]{11})") | |
YOUTUBE_EMBED = """ |
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
@echo off | |
:: sample usage | |
call:getMMDDYYYY _DATE | |
echo _DATE: %_DATE% | |
goto:eof | |
:: ----------------------------------------------------------------------------- | |
:: The "function" |
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
@ECHO OFF | |
ECHO. | |
:: Check the Windows version | |
IF NOT "%OS%"=="Windows_NT" GOTO Syntax | |
SETLOCAL | |
:: Initialize variable | |
SET Error=0 |
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
@echo off | |
setlocal | |
set Error=0 | |
if "%~1" == "" goto SYNTAX | |
if not "%~2" == "" goto SYNTAX | |
for %%A in (%DATE%) do set cDate=%%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
call :sleep %~1 | |
goto:eof | |
:: ----------------------------------------------------------------------------- | |
:sleep | |
ping 127.1 -n 2 -w 1000 > NUL | |
ping 127.1 -n %~1 -w 1000 > NUL | |
goto:eof |
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
# -*- coding: utf-8 -*- | |
"""A thread pool implementation. | |
Parts of this module are derived from: | |
http://code.activestate.com/recipes/203871-a-generic-programming-thread-pool/ | |
""" | |
import time |
OlderNewer