Bellingham, WA, USA | [email protected]
Agile Development: web sites/applications/services, modules, plugins, widgets
Small Business Portals: CRMs, Storefronts, Mapping Applications
Personal Sites: Blogs, Portfolio's, Informational Sites
//http://en.wikipedia.org/wiki/Rot13 | |
//var name = "Brian Teachman"; | |
//var token = "Oevna Grnpuzna"; | |
function rot13(name) { | |
var lt1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "; | |
var lt2 = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm "; | |
var result = ""; |
function Rot13() { | |
var result = ""; | |
var decode = false; | |
var lookup = function(char, i) { | |
var lt1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "; | |
var lt2 = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm "; | |
var orig = (decode) ? lt2: lt1; | |
var enc = (decode) ? lt1: lt2; |
<?php | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
#!/usr/bin/php | |
<?php | |
$profile = function() { | |
static $start = '0'; | |
list($timestamp, $microseconds) = split(' ', microtime()); | |
$current = bcadd($timestamp, $microseconds, 4); | |
if ($start === '0') { | |
$start = $current; | |
return; | |
} |
// http://net.tutsplus.com/tutorials/javascript-ajax/meet-crockford%E2%80%99s-jscheck/ | |
(function () { | |
var PasswordScorer = {}; | |
PasswordScorer.score = function (password) { | |
var len = password.length, | |
lengthScore = 0, | |
letterScore = 0, | |
chars = {} | |
if (len >= 21) { lengthScore = 7; } |
## | |
# My solution is not the shortest, but it makes sense to me. | |
## | |
def print_abacus(value): | |
abacus, rod, slices = '', '00000*****', [] | |
for char in str(value): | |
# is there any reason not to use a list of dictionaries? | |
slices.append({'left': (10 - int(char)), 'right': (10 - (10 - int(char)))}) | |
rows = len(slices) # does it make sense to cache here? | |
if rows < 10: |
<?php | |
//http://www.ranks.nl/resources/stopwords.html | |
return $stop_words = array( | |
'a', | |
'about', | |
'above', | |
'after', | |
'again', | |
'against', | |
'all', |
# http://xael.org/norman/python/python-nmap | |
# lets check for common ports using nmap | |
import nmap | |
nmScan = nmap.PortScanner() | |
nmScan.scan('127.0.0.1', '0-1023') | |
for port in nmScan['127.0.0.1']['tcp']: | |
thisDict = nmScan['127.0.0.1']['tcp'][port] | |
print 'Port ' + str(port) + ': ' + thisDict['product'] + ', v' + thisDict['version'] |
Bellingham, WA, USA | [email protected]
Agile Development: web sites/applications/services, modules, plugins, widgets
Small Business Portals: CRMs, Storefronts, Mapping Applications
Personal Sites: Blogs, Portfolio's, Informational Sites