Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

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 | 1404 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 | 1161 Views

Don't sell me 500mb/month limit and tell me its good

O2 are putting in a low, 500mb a month (thats around 16mb a day, don't forget that!), limit for mobile data and their excuse reason is:

"We don't think it's fair that the many should subsidise the behaviour of the few, and we think that we have a responsility to our customers to address this kind of imbalance." ... "97% of our smartphone customers currently use less than 500MB of data every month"

To me that actually says "3% of our users are causing such a strain on our network everyone needs to pay the price"

You can argue that some people might only use 200mb/month and thats fine, but thats what they are using today! As core functionality like "facetime" (which Nokia and a lot of other phones had before it was "new") and HD video become the norm this is going to go up, quickly!

Lets put 16mb per day in to context. Using typical examples from O2 this is how it breaks down:

Usage per day!
YouTube video (4.5 mins) 2 videos
Music track download low quality) 1.6 trakcs! If you use spotify premium or last.fm. BOOM!
Basic web page (100KB) 166. Facebook before you login is 86 KB
Rich web page (300KB) 50. My twitter.com page is 246KB so that is 50 page refreshes

When you look at these figure and think, "I won't look at 166 basic web pages a day" just remember you need to include all the other apps which are also using your bandwidth like emails and push services. Start going in to a app like Dropbox and pulling up that PDF then thats your daily limit gone quite quickly.

I'm not just saying "give me unlimited". I'm not stupid. "Network resources are finite. You can't offer infinite consumption of finite resources". All I am saying is find out why these 3% are using 1Gb a month (or more) and see what needs to change there. It might be as simple as the 3% are jailbreaking their phones to tether to their machines. In which case they are breaking the TOC so dump them.

I don't know the right answer here, but 500mb is the wrong one! Before we commit to anything as users we need to know some basic information:

  1. over the last 12 month have I even come close to the 500mb limit?
  2. can i put a restriction in place to physically stop me from going over the limit?
  3. how well (and accurately) will this be reported to me? (And don't say by text message as that uses the precious, buckling, network that we are trying to protect)? *there is sarcasm in there*

Update: Once you hit your limit your data speed will slow down. You will not be charged more. Which is nice!

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

Multiple Skype accounts

This isn't really a Skype or Mac specific solution but a general *nix way of running two instances of one program. You will need another account on your machine so if you haven't got one create that now. I haven't played around with the permissions on the second user to see what works but I am assuming they would need admin rights (open to feedback on that).

From the terminal:
view plain print about
1$ sudo su - [your other username]
2$ /Applications/Skype.app/Contents/MacOS/Skype

This should launch a second Skype app but remember you are logged in as them! This mean for example that if you download a file it will go in to that users Download folder NOT yours! Of course if you are doing this regulary enough you could wrap it up in a shell script to make life easier

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

Why no one feels bad for the music industry

Posted on Twitter by RobRohan This image pretty much sums up how much influence the entertainment industry(corporations) have over legal systems.

What is important here is that both highlighted stories are about compensation for loss but somehow uploading a music single is the worse act over death of a person in an air accident. If organisations like RIAA took the money and time they spend on suing people and getting government legislations through on innovative ways of getting the music out to people then everyone would benefit ... surely

Comments Comments (6) | Print Print | Send Send | 1036 Views

The squirrel has left the building

Neil Middleton has turned off his ColdFusion/Flex/Flash feed aggregator, Feed-Squirrel which has been up and running for near 4 years.

You can read all the details in his post, I just wanted to help pass on the news for the community.

Don't forget to turn off your automated ping'ing if you were aggregated by the site

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

Changing BlogCFC's comment approval

One little thing thats bugged me with BlogCFC with moderated comments is the need to go from List > View Comment < back to list to approve. Silly I know but still ... So I've added the following on the comment.cfm page in the admin section

view plain print about
1<input type="button" name="approve" value="Approve" onclick="location.href='#application.rooturl#/admin/moderate.cfm?approve=#comment.id#'" />

All this does is add the button "Approve" to the view comment page to smooth out the flow of the process

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

Changing the jQuery location for BlogCFC

Another title for this post could be adding a property to BlogCFC. Basically I wanted to leverage Googles ajax API rather than use a local version of the jQuery library. There are a couple of reason for this such as distributed CDN delivery, better caching on the users machine etc, actually you might want to read this post to understand why you would want to do this at all.

Back to adding a property.

  1. We're going to edit the blog.ini.cfm (settings) file in org/camden/blog and add the following
    view plain print about
    1#jQueryLocation=http://{Your Blog URL}/includes/jquery.min.js
    2jqueryLocation=https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
    The first line is there for redundancy incase you need to test something locally or you are on a closed system with no web access. The second line is what we are insterested in for this post and points to Googles Ajax Library
  2. In Blog.cfc in org/camden/blog add the following to (around) line 101. It should be obvious where its going
    view plain print about
    1<cfset instance.jquerylocation = variables.utils.configParam(variables.cfgFile, arguments.name, "jquerylocation")>
  3. Finally in your Layout.cfm under tags/ change:
    view plain print about
    1<script type="text/javascript" src="#application.rooturl#/includes/jquery.min.js"></script>

    to the following

    view plain print about
    1<script type="text/javascript" src="#application.blog.getProperty("jquerylocation")#"></script>

At this point we are pretty much done in terms of getting done what we set out to do. The following bit of code adds the new setting to the admin pages so we can edit this in the future. What I explain next will add the jQuery location field to the settings.cfm in admin/

  1. Around line 91 the variable "keylist" is set. Add to the end "jqueryLocation"
  2. Find in the form where the "blogurl" is set and underneath add the following
    view plain print about
    1<tr>
    2<td align="right">jQuery Location:</td>
    3<td><input type="text" name="jqueryLocation" value="#form.jqueryLocation#" class="txtField" maxlength="255"></td>
    4</tr>
  3. The final part is the validation rule. All I am doing is checking the value given is a valid URL. You could expand on this but for my purposes this will do just fine. Look for <cfif structKeyExists(form, "save")> which is the start of the validation, go down a few lines and among the other rules add
    view plain print about
    1<cfif NOT reFind("https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?", form.jqueryLocation)>
    2<cfset arrayAppend(errors, "Your jQuery location must be a valid URL.")>
    3</cfif>
Thats it, you're done now. Going to your settings and updating them will remove the commented out line we added in point one earlier but with a method to easily edit the location this shouldn't be a problem now

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

Ive gone from Wordpress back to BlogCFC. Woohoo!

Around last May 2009 I moved my blog away from CF to Wordpress (PHP), the main reason was for the bloggin tools i.e. iPhone app etc, plus the skinning was easy as dropping a folder on your server. Well over the holiday break I've moved back to BlogCFC. Theres are a few reasons which I thought were worth putting a blog post together:

  1. I was never happy with Wordpress. Thats not to say its not a great blogging software/platform but I had a few issues with plugins and skins which meant either digging into rights management or even editing PHP(UCK!). The reason for moving to Wordpress after-all was because I didn't want to think about maintaining my blogs code.
    Yes the iphone app was good to have but I didn't use it as much as I thought I would and it wasn't as good as I imagined it being, so this ended up being a mute point anyway.
  2. Next I thought why even host my own blog and I looked around at the likes of Posterous which I know of some CF devs have moved over too. It seemed a neat blogging tool again, email your posts in etc, but then I didn't like handy over all of my data to a third party plus what if they vanished over night or simply the data got corrupted.
So here I am back on BlogCFC again. Skinning the blog myself and hacking away with it and already got some idea's which I want to submit to the project which has got me excited about blogging again. Having a CF blog means that I have somewhere to test code and ideas. Plus if I want the features I see in other tools it gives me a way to give back to the community.

Comments Comments (5) | Print Print | Send Send | 866 Views

Im on twitter

This isn't new news to anyone but I thought I should still mention it.

I was catching up on an old CFHour() podcast while driving on my commute to the office and back today when one of the Q&A sessions asked whether a ColdFusion'er should blog (they should!). It did make me think about myself and why I don't blog as much recently.

I've been blogging in some form or another for some years now but over the last couple of years my posts have dwindled. Not because I have lost interest, since Railo went open source I now host my own server, but because I've been busy with my main work either doing development which is trivial or stuff that's has been blogged about elsewhere. That is not to say I don't come across new issues & fixes but when I do I'm on Twitter talking about them nowadays.

I do plan to pick up the blogging as I have quite a few little sidelines projects which I hope to bring up at some point but till then make sure follow me at www.twitter.com/andyj

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

More Entries

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