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
| from django import http | |
| from django.utils.http import urlquote | |
| from django.core import urlresolvers | |
| class AppendOrRemoveSlashMiddleware(object): | |
| """ | |
| Like django's built in APPEND_SLASH functionality, but also works in reverse. Eg | |
| will remove the slash if a slash-appended url won't resolve, but its non-slashed | |
| counterpart will. |
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
| from django.http import HttpResponseRedirect | |
| import re | |
| slash_re = re.compile('/{2,}') | |
| class SingleSlashes: | |
| """ This middleware removes extra back2back slashes from an incoming request """ | |
| def process_request(self, request): | |
| if '//' in request.path: | |
| new_path = slash_re.sub('/', request.path) |
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
| # By Val Neekman (val@neekware.com) | |
| import os, urllib2, sys, re, datetime, smtplib | |
| ## HOWTO: | |
| # Change the following settings then run this script as "python loto_robo.py" | |
| ###### Settings ######## | |
| SEND_EMAIL = True | |
| FROMADDR = "val@neekware.com" |
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
| # Start and stop headless VMs | |
| # Val Neekman @ Neekware Inc. | |
| # un33kvu@gmail.com | |
| # You need to fix this to point to the right directory on your MAC | |
| VMHOME="${HOME}/Documents/VMs" | |
| if [ -z $1 ] | |
| then echo "Usage: vm stop|start|stopall" | |
| exit 1 |
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
| # By Val Neekman [val@neekware.com | |
| # Outsourcefactor.com | |
| # | |
| ScreenFlow Settings. | |
| File -> Export | |
| Preset = Web High | |
| File -> Export -> Customize -> |
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
| <?php | |
| // truncate string to specified length with ... at end | |
| ////////////////////////////////////////////////////////////// | |
| function jaStrTrunc($str, $size) | |
| { | |
| $slen = strlen($str); | |
| if ($slen < $size){ | |
| return $str; | |
| } |
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
| RewriteEngine On | |
| RewriteRule ^(.*)$ http://192.168.224.128:8080/$1 [R=301,L] |
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 | |
| # one approach to the Conway's Game of Life | |
| # http://en.wikipedia.org/wiki/Conway's_Game_of_Life | |
| # Val Neekman val@neekware.com | |
| # Open a terminal (Mac) 170 x 40, then run this script and see it for yourself | |
| # It is fun | |
| import os |
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
| #!/bin/bash | |
| #=============================================================================== | |
| # | |
| # FILE: getgeo.sh | |
| # | |
| # USAGE: ./getgeo.sh | |
| # | |
| # DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your | |
| # database | |
| # |