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
<html> | |
<head> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
var paths = [[ | |
new google.maps.LatLng(38.872886, -77.054720), | |
new google.maps.LatLng(38.872602, -77.058046), | |
new google.maps.LatLng(38.870080, -77.058604), | |
new google.maps.LatLng(38.868894, -77.055664), | |
new google.maps.LatLng(38.870598, -77.053346) |
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
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript"> | |
var map; | |
var marker; | |
var overlay; |
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
// http://koti.mbnet.fi/ojalesa/boundsbox/makemarker_circle.htm | |
/** | |
* makeMarker() ver 0.3 | |
* creates Marker and InfoWindow on a Map() named 'map' | |
* now creates alternatively a Circle if 'radius' option property is given | |
* creates sidebar row in a DIV 'sidebar' | |
* saves marker to markerArray and markerBounds | |
* @param options object for Marker, InfoWindow and SidebarItem | |
* @author Esa 2009, 2010 | |
*/ |
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
//http://wiki.cdyne.com/index.php/City_State_Zip_Regex | |
^(?<city>[A-Za-z\s]*)(?:,\s?(?<state>[\sA-Za-z]+)|\s(?<state>[A-Za-z]{2})) | |
(?: | |
(?:\d{1,4})| | |
(?<zip>\d{5})(?:-\d{0,3})| | |
(?<zip>\s\d{5})-(?<zip4>\d{4})| | |
(?<zip>\s\d{5})| | |
(?<pc>\s[AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d)| | |
)$ |
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
/* | |
http://nemojkliknut.com/blog/javascript-sort-object-by-value/55 | |
a simple bubble sort algorithm on an object | |
*/ | |
function bubbleSortObject(object) { | |
for (i in object) { | |
for (k in object) { |
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
// http://www.latentmotion.com/how-to-sort-an-associative-array-object-in-javascript/ | |
function sortObj(arr){ | |
// Setup Arrays | |
var sortedKeys = new Array(); | |
var sortedObj = {}; | |
// Separate keys and sort them | |
for (var i in arr){ | |
sortedKeys.push(i); |
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
var anchors = document.getElementsByTagName("a"); | |
for (var i = 0, j = anchors.length; i < j; i += 1) { | |
// do some stuff here | |
} | |
var anchors = document.getElementsByTagName("a"); | |
for (var i = anchors.length; i > 0; i -= 1) { | |
// do some stuff here | |
} |
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 http://alecthegeek.wordpress.com/2007/02/09/handy-hackperl-dbi-count-rows-returned-from-select-statment/ | |
#In theory it’s a bad thing to assume a select will return a single scalar value instead of multiple attributes and rows, however with a count #clause we should be pretty safe. N.B. using the $dbh->rows() function or similar is not correct on a select statement. | |
my $rowCount = $dbh->selectrow_array( | |
qq{ | |
SELECT count(*) | |
FROM my_table | |
WHERE attr1 = ? | |
}, undef, $myValue); |
NewerOlder