Australia post provides an API here:
You need to post the following values to http://drc.edeliver.com.au/ratecalc.asp
Aus post calculates the weight of a package by either the cubic weight or actual weight, whichever is greater.
For example: if you have a 2kg package with these dimensions: 80cm(length) x 20cm(height) x 30cm(width) then the actual weight you will be charged for is:
Step 1: work out cubic meters: 0.80 x 0.20 x 0.30 = 0.048
Step 2: work out cubic weight: 0.048 x 250 = 12kg
That means, your 3kg package that is 80x20x30 you will actually be charged for a parcel that weighs 12kg!
Currently working on a prestashop australia post calculator module, I will post it here and on prestashop forums when it is complete.
Here's a quick howto on setting up Google Maps on your website.
Ideal for "Contact Us" pages.
Continue Reading »Getting Toad to work with Oracle doesn't seem to be explained very well anywhere.
Here's a quick list:
Here is an example of a tnsnames.ora file for Toad
IDENTIFIER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.123)(PORT = 1521))
)
(CONNECT_DATA = (SID = orcl))
)
Once this file is there you can re-open Toad and use "IDENTIFIER" as the connection identifier (drop down list). Toad will then know that it has to connect to the oracle server at 192.168.0.123 on port 1521
Here's an example showing multiple tinyMCE editable regions been controlled from (what appears to be) a single tinyMCE menu.
This is also a good example of how to use tinyMCE with an iframe
http://examples.dtbaker.com.au/code/tinymce/
see the forum post here:
im getting lots of these across a whole bunch of apache log files:
Referrer: http://search.live.com/results.aspx?q=keyword&mrt=en-us&FORM=LIVSOP
IP Address: 65.55.165.88
User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322)
After some googling it seems this is part of some live.com's search engine quality checking blah blah
I have heard the bot downloads javascript and css files as well... who knows what this could be doing to things like adwords or google analytics.
So I just blocked them:
if(preg_match('/^65.55.165/',$_SERVER['REMOTE_ADDR'])){
header("Location: http://microsoft.com");
exit;
}
Sometimes it is useful to subimt a form into a popup window, here's a few ways to do it:
Continue Reading »The Facebooks footer:
Facebook © 2008
is made up of the following parts:
<div class="copyright">
<span title="Non-Trimmed">Facebook </span>
<span title="75">©</span>
<span title="10.16.93.101">20</span>
<span title="19269744">08</span>
</div>
Hover your mouse over the Facebook footer in a browser to see the title text appear.
What do these numbers mean I wonder...
the IP Address - the backend server handling the request?
the last number - the time it took to generate the page?
Pretty easy, just do:
tinyMCE.init({
theme: "advanced",
//etc....
theme_advanced_styles: "className=Class Name;imgclass=Images",
//etc....
}); and your custom styles will be available in all popups etc..
One day I needed to create thumbnails of about 300 websites, this would usually take a very long time, so I wacked together a simple shell script which makes use of Firefox, Xvfb, and Imagemagick
The script creates a virtual X desktop, starts a Firefox instance, and then, using the openUrl command, proceeds to load each website and capture a screenshot one at a time.
If you cannot get Xvfb working, you should be able to run this with little modification on a spare linux desktop. I suggest you play with image magicks cropping tools to remove the firefox decal.
here is the original bash script: Continue Reading »Here's a little script I wrote ages ago that could collect users mouse movements and clicks on a site, save to a database, and generate an image showing a "click stream" of the users activity.
:
When you sign into Facebook or Flickr whilst using Flock you will have access to a list of your friends via the People Bar.
Flock does this by calling the Facebook / Flicr API's
Here is an example request as seen in a wireshark dump:
GET /restserver.php?query=SELECT uid,name,pic_square,status,profile_update_time
FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = 123456789)&
api_key=123456&session_key=12345&call_id=12345&method=facebook.fql.query&
format=JSON&v=1.0&sig=12345
HTTP/1.1
Host: api.facebook.com
(flock facebook code: http://svn-mirror.flock.com/trac/flock/browser/trunk/mozilla/flock/base/services/ )
Flickr is accessed a similar way, via their rest interface - eg:
GET /services/rest/?method=blah.blah
Host: www.flickr.com
Wrote this when hunting for a house.
Pretty much a scraper for realestate.com.au, displaying search results in a much more user friendly and advertisement free way. Also includes a couple more options than what is available in the usual realestate search form.
And also the ability to quickly categorise and remove results from appearing again.
http://examples.dtbaker.com.au/code/realestate/s.php
Will publish the code after a little clean up.
Ran this on my home PC while overseas to transfer money between accounts / credit cards.
Could hit it up with an email like: Transfer $100 to Account B and away it goes.
Much more secure and faster than typing in my netbank login details in some foreign internet cafe (especially when the keyboard is in another language)
Will open source the code once I clean it up a little.
Virgin doesn't email statements out, you have to log in to check balances etc..
Logging in via their interface sucks balls, so I wrote this to do it automatically.
Will publish after a little clean up.
Some friends of mine recently became a little bit obsessed with the share market, recording share prices in a little book through out the day.
This will automatically log in an export your CommSec watch list and save it to a database. Much easier than scribbling down share prices in a book 20 times a day.
Could also set it up to automatically buy/sell when stock reaches a certain price. A feature that doesn't exist in CommSec at the moment.
(Will publish after a clean up)
Whenever trying to Google for help on error messages I usually get an experts-exchange.com result or 3 on the first page.
Problem is you need to become a "Premium Service Members" in order to view the responses.
bah!
Lucky for us, experts exchange does a little bit of dodgey search engine stuff =)
Instead of clicking the link taking you directly to experts exchange, simply click the "Cached" link. You will notice the cached version of experts exchange is very different. Scroll down past the huge block of links and presto, there's the posts.
No need to become a premium member.
It looks like NetRegistry only has Zeus and IIS hosting accounts.
So any apache thingeys like mod_rewrite wont work.
Also you will need to set you own custom PHP temporary session directory to get PHP sessions working correctly.
If you have a script that runs for a long time and you would like to update the browser with some progress reports here is a very simple way of doing it:
script.php:
<html>
<body>
<div id="messages"></div>
</body>
<?php
function w($message){
?> <script language="javascript">
document.getElementById('messages').innerHTML =
document.getElementById('messages').innerHTML + "<?=$message;?>";
</script> <?php
@ob_flush(); @flush();
}
//example:
w("Here is a message");
sleep(5);
w("And another message");
sleep(5);
w("And yet another message");
?>
</html>
View an example here: click
Ran into a problem trying to use mod_rewrite in .htaccess on a Melbourne IT hosting account.
They seem to run PHP as CGI instead of an Apache module. Read the differences here: http://blog.dreamhosters.com/kbase/index.cgi?area=2933
Here's the rewrite script that worked in the end:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L,QSA]
The problem was a missing / before the index.php
jQuery - Duplicate Select Boxes
Ever wanted a allow the user to add or remove select boxes (or any other form elements for that matter) .. here's how...
Continue Reading »
|
Collector Comics is THE place to buy, sell, and research comics online. Launching soon.
Launch »
Screenshot »
|
|
Webitor is a kick-ass easy to use, easy to extend, non-database driven Content Management System. Version 2 with reseller plan coming soon.
Launch »
Version 1 »
|
|
GC Lounge is my own pet social network and test bed for social related code. Made by locals for locals.
Launch »
|
|
GG has indexed over half a million recent Trade Mark applications. This revolutionary tool is extremely valuable for industry experts.
Launch »
|
|
GCWiFi is the hub for techies interested in joining a ad-hoc wireless mesh spread across the Gold Coast
Launch »
|
|
Web based financial client management system
Launch »
|
|
OS Commerce modules and template modification
Launch »
|
| View More Projects » | |