-
"The amygdala is the “fight or flight” and emotional memory part of the brain. Its job is to protect by comparing incoming data with emotional memories. An amygdala hijack occurs when we respond out of measure with the actual threat because it has triggered a much more significant emotional threat." Wow, there's actually science behind that feeling. Useful to give it a name, too.
-
"This is why I tell people over and over again: you cannot trust what you see even with your own eyes. Your eyes are not cameras faithfully taking pictures of absolute truth of all that surrounds you. They have filters, and your brain has to interpret the jangled mess it gets fed. Colors are not what they appear, shapes are not what they appear (that zoomed image above is square, believe it or not), objects are not what they appear." This is crazy – and one of the few optical illusions I've seen that still works when zoomed-in super close. It's so hard to make head or tail of.
-
"So, to sum up: Transformers: Revenge Of The Fallen is one of the greatest achievements in the history of cinema, if not the greatest. You could easily argue that cinema, as an artform, has all been leading up to this. It will destabilize your limbic system, probably forever, and make you doubt the solidity of your surroundings. Generations of auteurs have struggled, in vain, to create a cinematic experience as overwhelming, and as liberating, as ROTF." This review is, essentially, amazing, and has elevated ROTF to a must-see for me.
-
"I'm continually drawn in by the belief that everyone finds their own way through life, age, cities, networks, whatever. And as Meehan's tale recounts, it's the whispers we leave on the wind that entice others to follow our hints." Just go and read the story; it's wonderful, and the fragments George picks out so carefully constructed. That made my evening.
An ExceptionNotifier for CodeIgniter
25 June 2009
CodeIgniter really is turning out to be The Little PHP Framework That Could. I’ve now dived pretty deep into it and still have few complaints; as I’ve said before, it makes all the boring stuff easy, has almost no “magic”, and stays out of the way.
As the application moves towards production, though, I began to miss a few things from Rails – notably, its ExceptionNotifier plugin. ExceptionNotifier will send you an email every time there’s an error on the site, which is really very useful with production applications.
So I investigated alternatives for CodeIgniter. I stumbled across this Stack Overflow post, which basically outlines exactly what I was looking for.
Except it doesn’t work.
Never mind! We can fix that, and the end result is MY_Exceptions.php
:
(You might want to “view raw” on that – there’s some funky syntax-highlighting going on).
This really does work out-of-the-box with CodeIgniter 1.7.x. You just drop it into system/application/library
, call it MY_Exceptions.php
, and it’ll extend the existing Exceptions library. Obviously, you’re going to need to change a lot of the obvious details like email addresses you want things sent to, and the name of the production domain you’ve configured in your app’s config.php
. You also need to make sure the error log level is set to “1” or higher in that config.php
file. But that’s about it; it really does work, and means that in production alone, you’ll get email from your app when a PHP error gets thrown, along with not only the line number and file the error was thrown in, but the URL that the user was accessing to generate the problem.
Not bad for an hour’s work. And, because it’s a Gist, you can either copy and paste, or just clone it straight into your application.