February 16th, 2009, by fitzy
Just moments ago, we sent out a newsletter (view here) to all our customers introducing them to our February web site give-away. If you or someone you know is thinking about building a web site, this may come in handy. The condition? If 5 or more web sites are commissioned this month, we will draw one lucky winner out of the coveted TFG stubby holder to have their site paid for by us.
You can get in contact with our team here to get your site underway. At the end of the month if you’re the lucky customer, any monies paid to that date will be refunded.
The winner of this give-away will receive a standard business web site (valued at $4,500) free. We’ll also couple this with a 12 month subscription to our flagship product AuroraCMS. AuroraCMS will enable you to maintain and update your site for the next 12 months with no more to pay.
Also this month we’ll be donating $250 from every web site commissioned to the NAB Victoria Bushfire Relief Fund to help those in need.
If you’re interested in signing up to our regular newsletter, please do so at our web site. You can also follow us on Twitter or on our Facebook page for more updates.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: free website
Posted in Inside TFG, Websites or Tools | No Comments »
February 12th, 2009, by aaron
This morning I had to solve a problem that involved an application inside an IFrame not keeping it’s session state. I’d solved this problem many times before, a long time ago, in a galaxy far far away, but still it stumped me again!
In this example we had two client websites we’ll call site-a.com and site-b.com. Site-a.com had a page that contained an IFrame which sourced it’s content from site-b.com. The page on site-b.com allowed the user to log in to the application that resides on the site-b.com domain and then click on various links that would take them to other areas in the site-b.com application.
This worked perfectly in Firefox and Safari, but in IE7 it failed and would not let the user log in. After setting up a test environment on my virtual machine and repeating the bug I went looking for a solution.
It turned out that what was required was a declaration by site-b.com that it was okay to do what I was trying to do. It seems that as long as site-b.com declares that it’s safe then the browser assumes this to be the case and it all starts to work.
The way this is done is through adding P3P info to the header of the response. Essentially what this does is say to the browser that your application is okay with taking information from other domains. Rather than relying on external security measures, you’ve taken the steps yourself to develop a secure application. This sort of setting can also be used for single sign on situations too where your cookies need to be accessible across domains and applications.
Typically it’s as simple as adding :
header('P3P: CP="CAO PSA OUR"');
to the page. You could also add it on the server level if required, but in this case it all takes place in an extranet module so it’s perfectly suitable to be applied only on one page. There are quite a few options that you can find on the P3P Specification.
So that’s how you get cross domain cookies to work with PHP. It’s much the same in other web frameworks, you just need to work out how to modify the headers in the one you’re using.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: Cookies, IFrame, P3P, PHP, Security
Posted in Code, Tips and Tricks | 2 Comments »
February 10th, 2009, by aaron
I’ve been slowly making my way through Douglas Crockford’s talk on Advanced Javascript and even at only about 3/4 of the way through the first installment I’ve learned plenty!
The presentation is in three parts and so far he’s covered a bunch of standard programming patterns and elements (singletons, private members, namespaces, constructors, etc…) implemented using Javascript as well as a detailed account of how the language is implemented. Rather than having to work out by trial and error what variables and functions are available where, or how to implement private functions or a singleton, he’s given you the first principles so you can work it out for yourself and a bunch of useful examples.
I highly recommend watching it. I find the more languages I learn the better I get at doing things across the board.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: Javascript, Presentation, Programming
Posted in Tips and Tricks | No Comments »
February 5th, 2009, by aaron
In PHP4 objects were passed by value, it’s probably the intuitive way to deal with variables for a beginner and in a language where objects are not first class. However in PHP5 this has been changed and now objects are passed by reference, this stung me when writing some tests recently.
public function testNameIsUnique() {
$test1 = $this->BuildValidDiscountType();
$test2 = $test1;
$test1->Save();
$this->assertTrue($test1->id > 0);
$this->setExpectedException('DiscountTypeException');
$test2->Save();
}
This code shouldn’t have worked as far as I was concerned, in fact I was expecting an exception to be raised. Instead it was working and after a little debug tour I found that my $test1 = $test2 line was causing $test2 to be a reference to $test1, not what I wanted. This caused my update method to be triggered instead and of course the name is still unique.
It only required a small change to that line, using the clone specifier :
$test1 = clone $test2;
After that everything went as expected and I knocked off another test, and added to my PHP knowledge.
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: PHP, PHPUnit, TDD, Testing
Posted in Code, Tips and Tricks | No Comments »
February 4th, 2009, by aaron
I got sucked into the Ruby Manor site (in a good way) because of a presentation about the Rack spec and how it works. The Rack talk was quite short and to the point, but had some great examples of how to use Rack for micro-applications.
It’s a bit of a pain that the speaker didn’t repeat the questions in the Q&A section for the internet audience because for the latter third of the talk I had no idea what was being talked about. However the talk piqued my interest in learning a bit more about Rack and how it can be utilised when writing Ruby applications. I thought it might pique other peoples’ interest too!
We are a web development company and this is our blog. We specialize in building web applications with the Ruby on Rails framework. You can read more about our Ruby on Rails development or contact us.
Tags: Rack, ruby, Ruby on Rails
Posted in Ruby on Rails, Websites or Tools | No Comments »
Follow Us