Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

Detect IE8 Compatibility Mode

I have recently had a client who complained to me that the site was broken in IE8 even though I had already checked it out. It turns out the issue was M$'s great "Compatibility Mode"

I know my way around CSS well enough but it felt wrong making any changes to keep this IE only mode happy when all other browsers were not complaining. Bing! I had an idea and went to Google and found this document on Defining Document Compatibility.

Turns out I can force the users browser to IE8 mode with the following

view plain print about
1<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

Hopefully this will help some other developer with their designing woes.

Comments Comments (1) | Print Print | Send Send | 799 Views

Realisation

After all my years with computers this is still true
AndyJ: Created @ stripcreator.com

Created @ stripcreator.com

Comments Comments (0) | Print Print | Send Send | 873 Views

Gmail now has rich text signatures

From within the settings page of Gmail you can now create rich text signatures including changing font site, text align, style, colour, add images and links etc

Though this has been one (simple) feature missing from the product for a long time its not something I have missed. I know too many companies that abuse this feature and include un-needed images and just streams of multi-coloured text and links. Don't get me wrong, I am happy to see it, I am going to use it, but I am scared to see how some people will implement it.

Comments Comments (0) | Print Print | Send Send | 1078 Views

Pure CSS3 post it note

I've been ill the last couple of days which meant I couldn't really focus on anything too heavy. So with being awake half the night I thought I should just play around CSS3 and it didn't take long till I came up with a pure CSS3 Post-it note made with no images. The only extra library I have used in this demo is Google Fonts for the script text. Code after the note:

Back soon!


view plain print about
1<link href=' http://fonts.googleapis.com/css?family=Reenie+Beanie' rel='stylesheet' type='text/css'>
2<style>
3p.postit a{
4    color: black;
5    font-family: 'Reenie Beanie', arial, serif;
6    font-size:50px;
7    text-decoration:none;
8    text-shadow: 3px 3px 3px #AAA; }
9
10p.postit {
11    margin:100px auto;
12    text-align:center;
13    width:750px; }
14
15p.postit{
16    border:1px solid yellow;
17    height:300px;
18    line-height:300px;
19    width:400px;
20    background-color: rgba(60, 132, 198, 0.8);
21    background-image: -webkit-gradient(linear, 0% 0%, 0% 90%, from(#FFFAAE), to(#FFF057));
22    background-image: -moz-linear-gradient(#FFFAAE 0%, #FFF057 90%);
23    border-top-color: #FFF057;
24    border-right-color: #FFF057;
25    border-bottom-color: #FFF057;
26    border-left-color: #FFF057;
27    -webkit-box-shadow: #AAA 0px 10px 16px;
28    -moz-box-shadow: #AAA 0px 10px 16px; /* FF 3.5+ */}
29</style>
30<p class="postit">
31<a href="http://www.andyjarrett.com/blog" title="Andy Jarretts Blog">Back soon!</a>
32</p>

Quick discaimer - I have no ideas which browsers this works in. All I can tell you is that it looks good in Chrome and Safari!

Comments Comments (3) | Print Print | Send Send | 1406 Views

Friday Joke: The wish

A thanks for @bigmadkev for this little on topic gem!

Man walking along kicks a tin can and out pops a genie.

"I will grant you one wish" says the genie.

"I want to live forever" says the man.

"I can't grant wishes like that" the genie replies.

"Ok, I want to live until England win the World Cup" says the man.

"You crafty sod". replied the genie.

Which also reminds me of one other joke
What do you call an Englishman at the World Cup Final? The ref.

Comments Comments (0) | Print Print | Send Send | 1656 Views

Fridays Joke: The winning toast

I thought I had posted this one already, but I can't reference to it though that might be because I've been up since 4:20am with my brain ticking over like mad? Enjoy!

Patrick O'Malley hoisted his beer and said: "Here's to spending the rest of me life between the legs of me wife!" - and he took home the top prize for the best toast of the night.

In bed later that night, he told his wife: "Mary, I won the prize for the best toast of the night." She said, "Aye, Paddy, what was your toast?"

So he told her: "Here's to spending the rest of me life sitting in church beside me wife."

"Oh," she said, "that is very nice, dear."

The next day, Mary ran into one of Paddy's drinking partners in the street. Mischievously, the man said: "Did you hear about your husband winning a prize in the pub the other night for a toast about you, Mary?"

She replied: "Aye - and I was a bit surprised. Till now, he's only been down there twice. Once he fell asleep, and the other time I had to pull him by the ears to make him come".

Comments Comments (0) | Print Print | Send Send | 1256 Views

Scoth On The Rock 2011 Tickets on sale

Get 'em while they are Super Cheap, Fairly Cheap, or Kinda Cheap ... but just get 'em! Scotch on the Rocks is Europe's Longest Running ColdFusion Conference and in 2011 its gone back home to Edinburgh for 2011!

Register now at: http://sotr2011.eventbrite.com/

Comments Comments (0) | Print Print | Send Send | 914 Views

Query scripting bug in Coldfusion 9

I had a weird error this morning.

Named Sql parameter 'state ORDER' used in the query not found in the queryparams

Below is the code I had and it look fine to me:

view plain print about
1<cfscript>
2queryService = new query();
3queryService.setDatasource("cfdocexamples");
4queryService.setName("GetParks");
5queryService.addParam(name="state",value="MD",cfsqltype="VARCHAR");
6queryService.setSQL(
7"SELECT PARKNAME, REGION, STATE
8FROM Parks WHERE STATE = :state
9ORDER BY ParkName, State "
);
10result = queryService.execute();
11writeDump( result.getResult() );
12
</cfscript>
After staring at my code for a while and realising that doing that wouldn't fix anything I butchered played around with the syntax and found that after the WHERE clause you need to keep your SQL on one line. Making the following change to setSQL() fixed the problem:
view plain print about
1queryService.setSQL(
2"SELECT PARKNAME, REGION, STATE
3FROM Parks WHERE STATE = :state ORDER BY ParkName, State ");

I can't seem to find a reference as to how your SQL should be formatted but it seems the new line plays around with the deliminators and the way the named params are found.

I'm posting this now but will hopefully later find time to look in on query.cfc in the com/adobe/coldfusion folder under customtags to find the actual reason

Comments Comments (1) | Print Print | Send Send | 1321 Views

Blocking recent comment spam

There are a ton of ways to stop spam on blogs. This is my dirty (and not pretty) solution that I am adding to stop the recent wave of crap that is getting through the front end checks.

The long term plan is to put a back-end on this but for now here is v.00001

view plain print about
1<!--- Seperate with a pipe "|" as this is a regex list --->
2<cfset commentBlacklist = "coachoutletmall|wowgold" />
3<!---
4All the fields that we are going to check.
5Don't really need to check the email field as its not displayed.
6--->

7<cfset checkFields =trim(form.name) & trim(form.email) & trim(form.website) & trim(form.comments) />
8<!--- reFind to check the fields as they are past the other rules i.e. captcha --->
9<cfif reFindNoCase("#commentBlacklist#", checkFields, 1) >
10<cfoutput>Sorry deadbeat, I don't allow comment spam. If you feel you were wrongly blacklisted
11<a href="http://www.andyjarrett.com/blog/page.cfm/Contact-Me">Contact Me</a>
12</cfoutput>
13<cfabort>
14</cfif>

n.b. If you are on BlogCFC then this is for addcomment.cfm

Comments Comments (8) | Print Print | Send Send | 1162 Views

unix epoch with coldfusion

I never seem to remember that GetTickCount() gets the unix epoch time which is the number of seconds elapsed since midnight proleptic Coordinated Universal Time (UTC) of January 1, 1970 (from wiki

Comments Comments (0) | Print Print | Send Send | 1189 Views

More Entries

BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .