November 2010
2 posts
Royal Pingdom ยป Awesome visualizations of internet... →
BBC iPlayer - How Not To Live Your Life: Series 3:... →
October 2010
2 posts
Look! Savoury Broccoli Cupcakes | Apartment... →
Final Frame: Home Security Innovations by... →
January 2010
1 post
Flags css sprite
Flags of the world as a css sprite.
The flag icons are from Mark James’s FamFamFam collection while the code is a slightly simplified and condensed version of the csscountrycodes project on Google Code. Released under a GNU General Public License v2.
Includes 247 icons in total. The sprite image is over 51% smaller in filesize than the individual icons and can be downloaded in just one...
December 2009
6 posts
PHP
<?php
$q=$_GET["q"];
$con = mysql_connect('localhost', 'peter', 'abc123');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ajax_demo", $con);
$sql="SELECT * FROM user WHERE id = '".$q."'";
$result = mysql_query($sql);
echo "";
Javascript
var xmlhttp;
function showUser(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="getuser.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged()
{
if...
CSS
/*This is a comment*/
p
{
text-align:center;
/*This is another comment*/
color:black;
font-family:arial
}
MySQL import from CSV
LOAD DATA LOCAL INFILE '/Users/Dave/Downloads/codes.csv'
INTO TABLE codes
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
1 tag
Useful MySQL Commands
Change engine:
ALTER TABLE tbl_name ENGINE=InnoDB;
Change charset:
ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
Google Street View Examples
Google Street View API Docs
http://code.google.com/apis/maps/documentation/services.html#StreetviewClientQuerys
Google Maps API Reference
http://code.google.com/apis/maps/documentation/reference.html#GMarker
Rotating Canvas Marker
http://econym.org.uk/gmap/example_canvas.htm
Street View Map Sync (directional marker)
http://www.adamzastawski.com/samples/GoogleMapsStreetViewEvents.html
...
August 2009
1 post
Coding Horror: COBOL: Everywhere and Nowhere →