Alan Hart

web design… and other stuff

Alan Hart

How to Disable Javascript in your Browser

January 18th, 2012 . by Alan Hart

You can easily disable javascript in any browser completely or you can disable javascript for a specific site/domain in the Chrome Browser.

Note: Make sure you remember to re-enable javascript when you’re done!

Internet Explorer:
1. Click the little gear (top right)
2. Click “Internet Options”
3. Choose the “Security” Tab
4. Click “Custome Level…” Button (near the bottom)
5. Scroll down to the “Scripting Section”
6. Locate the Active scripting subheading and select the “Disable” radio button.
If you would rather be prompted each time a website attempts to launch any javascript code, select the “Prompt” radio button instead.

Chrome:
1. Click the spanner icon (“Customise and Control Google Chrome”)
2. Click “Options”
3. Click “Under the Bonnet”
4. Click the “Content Settings…” button at the top (next to where it says “Privacy”)
5. In the “Javascript” section make sure that “Allow all sites to run JavaScript (recommended)” is selected
6. then click the “Manage Exceptions…” button
7. Select “Block” from the drop down box
8. Enter the hostname in the text box: http://en.wikipedia.org
9. Hit Enter

(to remove this javascript block for after the “blackout” just goto the same “Manage exceptions” page hover your mouse over the wikipedia entry you added and click “X”)

Firefox:
1. On your keyboard hold down “Alt+T” together then tap “O”
2. Click the “Content” icon
3. Untick “Enable Javascript”
This will disable javascript on ALL sites you visit until you tick “Enable Javascript” box again

Safari:
1. Open Safari
2. On your keyboard hold down the “Ctrl” key and tap the comma [,] key
3. Select the “Security” icon
4. untick “Enable JavaScript”

Google Chrome – Disable Recently Visited Sites in New Tab

December 21st, 2011 . by Alan Hart

Sometimes you don’t want (or don’t want anyone else) to see a list of the last few pages you have visited in chrome.

To default to a different view whenever you
At the bottom of a new tab there are two options “Most Visited” and “Apps”. If you click “Apps” Chrome will now default to the Apps page instead of the Recently / Most visited page whenever you open a new tab.

At the time of writing there is no way to actually disable this recently visited sites page / thumbnails but you can install a 3rd party plugin such as Incredible Start Page which allows you to customise the new tab page really well.

View Google Checkout sales and invoices after upgrade to Google Wallet

November 28th, 2011 . by Alan Hart

Logged on this morning to find that my Google Checkout account had been changed to Google Wallet.

Not a huge deal i thought, until i realised that i couldn’t access my sales and invoices etc.

Easy way around this is to type this into the address bar

http://wallet.google.com/sell

This will take you to the checkout seller tools for orders and payments.

Tweet me (@alanhart) if this helped you.

Blackberry Email Setup doesn’t work after OS 6 update

November 18th, 2011 . by Alan Hart

So, I had my email accounts nicely setup on my Blackberry (on Vodafone but this is irrelevant).
I updated to OS 6 and both my email accounts continued to send/receive email absolutely fine.

However..

I later changed my email password for one of the accounts…

I received the usual message from blackberry a short time later telling me that it couldn’t access the Email account.
not a problem, i thought… i’ll just go into “Set-Up” then “Email Accounts” and change the password….
WRONG! … I clicked the Email Accounts icon… NOTHING! didn’t do anything!

“Bugger!” was the first thing i thought…

Eventually figured out that for some reason the Blackberry “Email Accounts / Email Setup” Application wasn’t even installed!

To rectify this very annoying problem…

  • 1. Simply plug your sync cable between your blackberry and pc
  • 2. Open the “Blackberry Desktop Software”
  • 3. Click “Applications” and find “Email Setup” in the list
    (see below)
    Blackberry-Email-Setup-Application-OS6
  • 4. If there’s a “+” button click this then click “Apply” at the bottom and it will install the Email Setup (takes a minute or two)
  • 5. Wait for your pc and blackberry to finish installing
  • 6. You should now be able to configure your email accounts on your blackberry!

Hope this helps you get ur email sorted on your BB, if it does or even if it doesn’t please tweet me

Toast Sandwich Diet – The Cheapest Diet Ever?

November 15th, 2011 . by Alan Hart

Toast sandwiches are a good way of saving money as well as calories.

Simply have one toast sandwich for lunch and nothing else.
Or for the less extreme approach have one for breakfast, one for lunch and one for dinner (only 990 calories per day)

Try it for a week or two and watch the weight fly off!

Ingreditents / Nutrition Information:
3 Slices of white bread (240 Calories)
10g Butter (90 Calories)
Total Calories: 330
Total Cost: About 7.5 Pence
You could make 13 Toast Sandwiches for one pound and still have 2.5p change!
The Toast Sandwich Diet costs less than 50p per week!

Carbohydrate: 55g
Protein: 9.5g
Fat: 12g
Fibre:4.5g
(Source: RSC)

How to make a Toast Sandwich:

  • 1. Toast a thin slice of bread
  • 2. Butter two slices of bread and sprinkle with salt and pepper to taste.
  • 3. Place the toast between the two slices of bread-and-butter to form a sandwich.

Healthy Variations:

  • Add an egg for more protein only adds about 8p to the cost PLUS keep you fuller for longer – also makes it taste a bit nicer.
  • Add half a can of sardines for more fat costs about 19p adds some fish to your diet and again helps you to feel fuller for longer.
  • For more nutrients try adding some vegetables, such as cucumbers or carrots or some tomatoes.
  • As a naughty treat add a small amount of grated cheese.

Recommended Daily Allowance
The new UK Department of Health Estimated Average Requirements (EAR) are a daily calorie intake of:

2079 calories per day for women (up from 1940)
2605 calories per day for men (up from 2550)

How many calories are needed each day can vary greatly depending on lifestyle and other factors.

Before making any changes to your regular diet i recommend that you talk to your doctor first so you can modify your diet program/plan based on known health issues together.

In the News:
BBC News: Toast sandwich is UK’s ‘cheapest meal’
The Guardian: The toast sandwich: can you jazz it up?

Update: Vodafone Mobile Connect software blocking websites?

October 26th, 2011 . by Alan Hart

Update 26/10/2011:

(Here’s the original post)

I emailed Vodafone with pretty much the same text as in my first post, here is the copied & pasted response…

Hello Alan,

Alan, as per your confirmation I have deleted your online account. As you are facing problems with the handset it needs to be checked manually to find out the exact error in your phone. I would recommend you to visit the nearest store to check your phone manually once; if the problem is negligible then it can be fix it there and then. If the problem persists please get back to us with the confirmation for postal repairs.

To know about nearest store please click here

In order to arrange for a postal repair please get back to us with the following details:
1. Make and model of your phone:
2. Colour of the phone
3. IMEI number of the phone. You can get the IMEI number by dialling *#06# on your phone.
4. Brief description of the problem you are facing with your phone
5. Alternate contact number and alternate address

Also, if you have any data on your phone that you wish to back up (including contacts), please do so before you visit the post office. If you are not sure how to do this, you will find more information in the handbook. Once the phone has been posted it isn’t possible to retrieve information stored on the phone and it may be lost during the repair process.

Furthermore, water or physical damage is not covered by the manufacturer’s warranty and upon receipt if the repair centre discovers that your phone is damaged due to physical or water damage then we will be unable to repair your phone and will return it to you un-repaired or inform you about the charges for repair.

Alternatively, you can call our Technical team on 08700700191 then select option 2 and then option 2 again. They will be able to assist you regarding this matter. You can call them any time between 10:00 a.m. – 5:00 p.m.

I trust I was cordiale enough in providing you the information.

Kind regards,

Kanika Dham
Vodafone Customer Services

Thankfully my online account has not actually been deleted!

Received a tweet from @VodafoneUK this morning saying:

Ive asked one of the team to pick up your eForum post this morning and they’ll be in touch shortly ^SM

Hoping someone will get back to me with some kind of coherent response.

As an aside, i’ve tried hunting for the latest version of the vodafone connect software, i managed to stumble (after about 45 mins of looking) upon a download link (in the business section of the website) but when clicked the link was dead!

Vodafone Mobile Connect software blocking websites?

October 18th, 2011 . by Alan Hart

Been having a problem for a while now…

We have various vodafone mobile connect devices in our company.
When the Mobile Connect software is installed on any of our user’s laptops they can connect to every site on the web except for our company websites. Sometimes it loads the web page title and stops other times it will just timeout.

We have a few sites hosted on the same (shared) IP address and all of these (including this site, as it’s on the same host) are inaccessble if the mobile connect software is installed. Even if we are connecting through our own wired or wireless office network.

I am certain that it is the vodafone mobile conect software causing this because as soon as the software is uninstalled our websites are instantly accessible again.

This is a very strange problem. I have googled it but havent found anyone else with this same problem.

Has anyone else had this problem? it’s obvioulsy a pain for our guys to keep uninstalling the software just to view our own websites and reinstalling when they leave the office.

I’ve emailed Vodafone today so will see what they say.

Single PHP error page to handle all response headers / errors

September 19th, 2011 . by Alan Hart

There might be an easier way of doing this but i’ve been working on a project which needed the following which i have done as a simple single php page and thought i’d share it in case anyone wants to do the same thing.

  1. Error page generated by dynamic pages
    (using any code; 403, 404 etc)
  2. Error page to handle genuine errors
    (404 ‘Not Found’, 403 ‘Forbidden’ etc)
  3. Forbid visitors from visiting sensitive areas/directories
    also returning 403 ‘forbidden’ header.
    (e.g. /images, /css /javascript, /ajax etc)

Download all these files: http-error-code.zip

instructions for use are commented within the error.php code but in summary:

You need to create a .htaccess entry for each error code:

Code for .htaccess:


ErrorDocument 403 /error/error.php
ErrorDocument 404 /error/error.php

For forbidden folders just add this code into a file called index.php then put this file into the folder that you want to forbid directory listing for:

Code for index.php:

<?php
// Set response code
$error = 403; //Forbidden
// include the error page (
include ($_SERVER['DOCUMENT_ROOT'].'/error/error.php'); // assuming "/error/error.php" is the location/name of this file
// stop processing the current page
exit();
?>

Save this code to a file called error.php and save to yourdomain.com/errors/error.php

Code for error.php:

<?php
/*
------------------------------------------
PHP Response Header / Error Page Generator
------------------------------------------
Created by Alan Hart (www.alanhart.co.uk)
19/09/2011
------------------------------------------

To generate response from another page, as a result of incorrect database query or invalid content etc just add this code:
(make sure no page output has been generated before this include)

<?php
// Set response code
$error = 403; //Forbidden
// include the error page (
include ($_SERVER['DOCUMENT_ROOT'].'/error/error.php'); // assuming "/error/error.php" is the location/name of this file
// stop processing the current page
exit();
?>

-------------------------------------------------------
TIP:
-------------------------------------------------------
Hide the default directory listing for a folder
e.g. /images, /css, /java etc.

1. create a blank file called index.php
2. paste the php code above into the file
3. place it inside the folder
-------------------------------------------------------
*/

// ------------------------------
// THE CODE...
// ------------------------------

// if the error code has been set by referring page:
if ($error <> ""){
// Use the error code from referring page
$code = $error;
} else {
// Use the error code from server
$code = $_SERVER['REDIRECT_STATUS'];
}

// set $path variable to the requested path/uri
$path = $_SERVER['REQUEST_URI'];

// Create array with error codes and messages
// You must add a line to .htaccess for each code used here.
// e.g.
// ErrorDocument 403 /error/error.php
// ErrorDocument 404 /error/error.php
// etc...
// (assuming /error/error.php is the location/name of this file)

// Common Error Codes / Responses:
$response['403'] = array('title' => '403 Forbidden', 'message' => 'The server has refused to fulfill your request.
You do not have permission to access '.$path.' on this server.');
$response['404'] = array('title' => '404 Not found', 'message' => 'The document/file requested was not found on this server.') ;
$response['405'] = array('title' => '405 Method Not Allowed', 'message' => 'The method specified in the Request-Line is not allowed for the specified resource.') ;
$response['408'] = array('title' => '408 Request Timeout', 'message' => 'Your browser failed to send a request in the time allowed by the server.') ;
$response['500'] = array('title' => '500 Internal Server Error', 'message' => 'The request was unsuccessful due to an unexpected condition encountered by the server.') ;
$response['502'] = array('title' => '502 Bad Gateway', 'message' => 'The server received an invalid response from the upstream server while trying to fulfill the request.') ;
$response['504'] = array('title' => '504 Gateway Timeout', 'message' => 'The upstream server failed to send a request in the time allowed by the server.') ;

// Other header response codes (not necessarily errors) that you may want to use:
// $response['100'] = array('title' => '100 Continue', 'message' => 'Continue')
// $response['101'] = array('title' => '101 Switching Protocols', 'message' => 'Switching Protocols')
// $response['200'] = array('title' => '200 OK', 'message' => 'OK') // *Not an error so should never be handled by this script*
// $response['201'] = array('title' => '201 Created', 'message' => 'Created')
// $response['202'] = array('title' => '202 Accepted', 'message' => 'Accepted')
// $response['203'] = array('title' => '203 Non-Authoritative Information', 'message' => 'Non-Authoritative Information')
// $response['204'] = array('title' => '204 No Content', 'message' => 'No Content')
// $response['205'] = array('title' => '205 Reset Content', 'message' => 'Reset Content')
// $response['206'] = array('title' => '206 Partial Content', 'message' => 'Partial Content')
// $response['300'] = array('title' => '300 Multiple Choices', 'message' => 'Multiple Choices')
// $response['301'] = array('title' => '301 Moved Permanently', 'message' => 'Moved Permanently') // *Not an error so should never be handled by this script*
// $response['302'] = array('title' => '302 Found', 'message' => 'Found')
// $response['303'] = array('title' => '303 See Other', 'message' => 'See Other')
// $response['304'] = array('title' => '304 Not Modified', 'message' => 'Not Modified')
// $response['305'] = array('title' => '305 Use Proxy', 'message' => 'Use Proxy')
// $response['307'] = array('title' => '307 Temporary Redirect', 'message' => 'Temporary Redirect') // *Not an error so should never be handled by this script*
// $response['400'] = array('title' => '400 Bad Request', 'message' => 'Bad Request')
// $response['401'] = array('title' => '401 Unauthorized', 'message' => 'Unauthorized')
// $response['402'] = array('title' => '402 Payment Required', 'message' => 'Payment Required')
// $response['406'] = array('title' => '406 Not Acceptable', 'message' => 'Not Acceptable')
// $response['407'] = array('title' => '407 Proxy Authentication Required', 'message' => 'Proxy Authentication Required')
// $response['409'] = array('title' => '409 Conflict', 'message' => 'Conflict')
// $response['410'] = array('title' => '410 Gone', 'message' => 'Gone')
// $response['411'] = array('title' => '411 Length Required', 'message' => 'Length Required')
// $response['412'] = array('title' => '412 Precondition Failed', 'message' => 'Precondition Failed')
// $response['413'] = array('title' => '413 Request Entity Too Large', 'message' => 'Request Entity Too Large')
// $response['414'] = array('title' => '414 Request-URI Too Large', 'message' => 'Request-URI Too Large')
// $response['415'] = array('title' => '415 Unsupported Media Type', 'message' => 'Unsupported Media Type')
// $response['416'] = array('title' => '416 Requested range not satisfiable', 'message' => 'Requested range not satisfiable')
// $response['417'] = array('title' => '417 Expectation Failed', 'message' => 'Expectation Failed')
// $response['418'] = array('title' => '418 I\'m a teapot', 'message' => '(RFC 2324) Hyper Text Coffee Pot Control Protocol')
// $response['501'] = array('title' => '501 Not Implemented', 'message' => 'Not Implemented')
// $response['503'] = array('title' => '503 Service Unavailable', 'message' => 'Service Unavailable')

// get the relevant title from array
$title = $response[$status]['title'];

// get the relevant message from array
$message = $response[$status]['message'];

// return message if error code provided isn't in the $codes array
if ($title == false || strlen($code) != 3) {
$message = 'Please supply a valid status code.';
}
// Return response header(s) with relevant code
header("HTTP/1.1 ".$title);

// Customise the page to be displayed below...

// -------------------------------------------------------
// You can use the variables $title and $message in the page
// -------------------------------------------------------
// e.g.
//        echo "<h2>".$title."</h2><p>".$message."</p>";
// -------------------------------------------------------

// -------------------------------------------------------
// !! IMPORTANT !!
// -------------------------------------------------------
// if you want to include a header / footer in the page displayed
// make sure you use $_SERVER['DOCUMENT_ROOT'] in your include code
// e.g.
//         include($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
//
// this ensures the header/footer path is always correct
// e.g.
//        actual path of header.php = "http://www.domain.com/inc/header.php"
//         if path/uri is "domain.com/foo/" header path would incorrectly become "domain.com/foo/inc/header.php"
//        if path/uri is "domain.com/foo/bar/" header path would incorrectly become "domain.com/foo/bar/inc/header.php"
// -------------------------------------------------------

?>
<?php
// Include your own header here
//         include($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
// or use HTML as below
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Error: <?php print $title;?></title>
</head>
<body>
<center>
<?php echo '<h2>'.$title.'</h2><p>'.$message.'</p>'; ?>
</center>
<?php
// Include your own footer here
//         include($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
// or use HTML as below
?>
</body>
</html>

 

Pay off a mortgage in a year?

September 15th, 2011 . by Alan Hart

I have had a crazy idea to see if the combined generosity of complete strangers can help pay off our mortgage.

It might be a stupid idea and i’m guessing won’t even get a single donation, but maybe i’ll be proved wrong. If you dont ask you don’t get. right?

To donate please go to http://alanhart.chipin.com
All we need is just 160,000 people to donate 63p ($1)

If this does take off i’m hoping my blog will get a significant amount of visits so, because i’m such a nice guy, as a thank you (or incentive) for donating larger sums…

Every donation of $1 – $4.99…
will get a mention in a daily blog post

Every donation of $5 – $24.99…
will get a mention in a daily blog post with link to twitter or facebook profile

donations of $25 – $99.99…
will get a blog post on this website with link back to a website of your choice*

donations of $100 or more …
will get a blog post on this website with link back to a website of your choice*
AND
a link* in the links section in the sidebar (appears on every page of this site)

If you’re reading this please donate, remember all we need is just 160,000 people to donate 63p ($1)

*no illegal stuff please

connection to the server was reset in Hotmail, Firefox

August 19th, 2011 . by Alan Hart

Been having trouble logging into hotmail the last few days, after entering username and password, just get an error saying:

“The connection to the server was reset while the page was loading”

To clear this and actually log on to your hotmail just do the following:

if you have the “Web Developer Toolbar” plugin:
Click Miscellaneous > Clear Private Data > HTTP Authentication

If you don’t have the plugin:

  1. When in Firefox hold down:
    Ctrl + Shift + Del together
  2. Tick “Active Logins
  3. Click “Clear Now” button

Try and log into hotmail again and it will let you in, at last!

« Previous Entries