Last week Facebook rolled out a new update that lets people tag what they’re doing in their post or say how they are feeling. Users can say they are watching a movie or reading a book – amongst other things. What makes this different from before is that your status update is providing more structured data to Facebook about your activity. Continue reading
Author Archives: Dean
Web fonts not loading in Firefox
I encountered a peculiar issue today regarding web fonts on firefox. On all browsers except Firefox the web fonts were loading correctly. I found multiple references suggesting that Firefox was picky with using quotes when referencing where the font file is hosted. However my findings were more interesting:
Firefox does not support embedding webfont files from a different domain
The good news is the fix is simple. Simply send the following header:
Access-Control-Allow-Origin *
Ensuring facebook canvas applications work in IE8 / IE9 / IE10
Last week I deployed a new Facebook application into a production environment. Everything seemed to be working perfectly, but then I received a report that the application wasn’t working correctly in IE8+. I narrowed down the problem, and then realised that sessions weren’t working. It turns out IE8+ has a security policy that prevents iframes from setting cookies if the parent domain is different. Therefore because my PHP session cooking wouldn’t set, the sessions obviously didn’t work between pages.
The good news is the fix is simple. Add this header to your page:
header('p3p: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"'); |
If you want to read more about this check this page:
http://en.wikipedia.org/wiki/P3P
Bonus: if using silex add this middleware:
$app->after(function (Request $request, Response $response) { $response->headers->set('p3p', 'CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"'); }); |
How to install different locales on a fresh debian installation
Simples:
sudo dpkg-reconfigure locale |
This will load a GUI where you should select the new locales to install, then follow the onscreen instructions.
Silex Tip #1: How to quickly invalidate a form field in your controller
You should be using custom constraints to validate your form fields, however there are some use-cases where you need to quickly invalidate in a controller. To do this it’s quite easy:
$form->get('username')->addError(new \Symfony\Component\Form\FormError("This email is already in use")); |