Switching to PhpStorm

A few months back I retired Sublime Text from my day to day coding and have since switched to using PhpStorm as my go to editor. I do keep Sublime around for quick editing, writing blog posts, but I haven’t missed it otherwise. PhpStorm has a lot of nice features that you don’t realize sublime is missing until you switch. Here is my mini review on what I’ve found in the few months of using PhpStorm.

Git and Github

I have found the git and github integration brilliant. I really like opening issues right in the ide and it creating a new branch/workplace. At UserScape we do a lot with Trello and only use GitHub Issues for bugs so I don’t get to use this as much I would like. Maybe one day some one will integrate Trello. 🙂

Committing is also something I really like doing without having to leave my editor. It has this integrated via command + k. Or if you are old school you can just open the terminal tab. My personal preference is to visually commit so I only use the terminal when I have small changes.

Find Anything

Another huge feature is the search everywhere. I have this mapped to “command + t” to match Sublime but the original is a Double-Shift. This is way more powerful than Sublime though. You can find files, classes, actions and preferences. I really like the actions searching because I have a mental block and can never remember them. This is probably why I don’t enjoy VIM or anything else that requires me to learn key maps. As an example I like splitting the window so I just “command + t” type vertical and BAM the action shows and it splits. Maybe I want to diff the file, again command + t type annotate. These are huge time savers for me.

Terminal

The terminal integrated is brilliant. We use grunt for all our js and css and have a simple watch/reload task. So when I start editing I just open terminal run grunt watch and then open a new terminal tab for anything else I may need. Deploying, artisan, composer, etc.

Code Complete

PHP code completion is very nice but believe it or not I find the code complete in html and less way more beneficial. It works just as nice as the php auto complete and does a very good job filtering css classes to find the one you want without having to hunt it down. It also has great support for CoffeeScript (The ONLY way to write JS). 🙂

Themes and Interface

This is one area I do find frustrating at times. The default theme is Darcula and it is a huge improvement over previous versions and you can find a ton of themes at PhpStorm-Themes or my recent favorite Spacegrey. What frustrates me is the font adjustment and line-heights. Fonts typically look good at bigger sizes but when you set the size to 10 or 11 they just don’t feel crisp like Sublime. The line height is also crazy. You set it to 2.0 and then you get a monstrous cursor.

Tips

If you are currently using Sublime and want to try PhpStorm here are some tips I have. I would hide all the panels and just move in slowly. I started with just as a code editor and then slowly experimented with features until I found my ideal workflow. It has a huge number of features that I don’t understand and/or haven’t cared to fully investigate.

Expect it to be slower than Sublime. A lot goes on under the hood for finding things, auto completing, etc and it’s always going to be slower than sublime. I only really notice this at times but that first launch you will.

Laravel is my framework of choice and the code completion doesn’t work great with the facades. A work around is to add this composer package

"require-dev": {
    "barryvdh/laravel-ide-helper": "1.*"
},

Next go and watch some videos and read some posts that highlight features and show you tips you would otherwise miss.

All in all so far the features outweigh the annoyances I have so I am going to stick to using it for the foreseeable future. Big IDE’s aren’t for everyone, but I encourage you to give a PhpStorm a chance. I think you might just like it.

Write A Love Letter

The holidays are approaching fast and what better gift to give than a “love letter” to your loved ones. When I say love letter I’m not meaning the sappy kind that you are probably thinking about. No, I am talking about a letter from you to your family that outlines all the very personal important things they need to know in the event of your untimely death.

This is something much more personal than a legal contract such as a Last Will but would still be highly important to your family. I have seen a few examples of this letter but it’s easy enough that you do not need a template.

What I did was include three primary sections. The first a few paragraphs telling them what they mean to you, how much you love them, etc. The middle would have important private information about yourself. For me and I assume all my readers almost everything is in the computer so having the login and the password for 1password would be essential. These are the only two passwords they would need and from here could get access to pretty much anything. Then the final section describing how you want your funeral. Your favorite songs, favorite Bible verses, basically anything that would be important to you for your funeral.

For those that handle all/most of the finances it will be important to also have contact information on any of your advisors and any investment accounts. I have heard stories of families where one primarily handles all finances and the other not knowing or caring. This means if the one handles everything passes then the other will be in for a crazy life change. Anything you can do to make this easier would continue to show your love.

Finally, I would also start a journal if you haven’t. Three out of four of my grandparents have passed away and none of them kept a journal. Of course in my younger years this wouldn’t have meant anything to me but now as I’m getting older I would love to read all the stories they had. I’ve personally been using DayOne for the past year and it works well. It’s nice to have a place to keep your private thoughts, images of important events, and memories that would be forever lost otherwise.

Announcing Wardrobe

This site has always been my own little personal playground. I am constantly changing the design, the platform, and just experimenting.

Over the past few weeks I started building a brand new backend that I named Wardrobe. This was built from the ground up using Laravel 4, and Backbone.js with Marionette for the admin. The main goal was to create something minimal and simple to use.

Features

Even though it is minimal it still includes what I feel as the most critical features.

  1. Content
  2. Tagging
  3. Post Slugs
  4. Post Scheduling
  5. Post active/draft

Even though these are core features I only think content is a priority so everthing is hidden away but still quickly editable via the content toolbar.

Technologies

Because Laravel is awesome and very flexible I used that for the backend. The administration area is built using Backbone and Marionette to make everything feel super fast.

I have the luxury of being friends with the author Taylor so he made sure the backend was architecturally pure using service providers. Currently the backend only supports content stored in a database but because of the service providers swapping this out for flat files or some other service will be very easy.

I have used flat files with Jekyll and Statamic in the past but at the end of the day a database is so much easier to work with and I didn’t want to force a square peg in a round hole. 🙂

All the administration is written using CoffeeScript and follows a lot of the same principles as Brian Mann covers in his BackboneRails tutorials. I then use grunt to compile and concat everything.

Care and Feeding of a Robot

 

I had the honor and privilege to speak at the first ever Laravel conference. After my talk, I had a few people ask me about my slides so I wanted to share those and give little insight into how I created them.

First off, I was doing my presentation on an actual product. So I wanted to be sure that it wasn’t presented as a sales pitch. Instead, I wanted to just share some good tips and some of the things we had learned throughout the process of building it. So for that I wanted to step away from all the branding that we currently use for Snappy.

For the design, I based everything around two fonts. Veneer as the primary and Thirsty Script as a secondary font. Once I locked in my fonts I decided on using the color scheme that Yellow Design had in the font screenshots. I knew it would compliment the fonts nicely and look professional. From here I just made everything match and be super big.

Slides

Video

Presentation Design for Developers

I am excited that I will get to speak at the first ever Laravel conference next month. I am in the process of building my presentation and I wanted to share a lot of tips, tricks and resources that I have found along the way. With the goal it will help you if you are ever presenting and just need a quick start.

Presentation Planning

The first step is plan your presentation. I use pen and paper for this. Stepping away from the computer allows me to gather my thoughts better and not get sucked into just doing research and browsing. I found this really helps.

Next I take my brainstorming notes and opened up a markdown app. From here I actually write out everything in story form. From what I have read presentations are better if they tell a story so this helps me get all my thoughts together. Almost like I am writing a blog post.

Presentation Design

This is the hard part for me. I am not a strong designer but I feel like I have a good grasp of what good design is. In other words I know it when I see it. The problem is everything I create I never see it being any good. So I am sticking with the classic big font and single color background.

For the color scheme I like to stay away from common white or black backgrounds. I found a lot of great color schemes from kuler, colourlovers, and even dribble. Of course there are many more sites that offer color schemes. Just pick something that has good contrast so your words will “pop”.

Fonts are a real struggle for me. There are millions of fonts and I have wasted about 5 nights just this past week looking and searching for the perfect one. I personally only like at most two fonts and I usually go with two that have a big contrast. Something like a sans-serif for big bold titles and handwriting for subtitles. A good site for finding free fonts is fontsquirrel.

I save images to the very end because I am constantly changing things as I go. Since I am not really to this point I wanted to share a great site for finding creative commons images on Flickr. The site is CompFight. If you do want to go with a commercial offering istockphoto seems to be fairly inexpensive.

In the end visit SpeakerDeck and browse their Featured Presentations. Most of those look great and will give you great ideas.

Keynote Tips

I am far from a keynote expert but here is a few tips I have picked up while doing my design.

First open the color picker box and get the color you want. Next drag this color down into the little swatches box. By doing this you can get all the colors you are going to use and have quick access to them. Here is an example:

keynote-colorpicker

I have found working with fonts a chore. I choose the generic white template as a base and it always reverted to Gil Sans. So any text box I add I then had to go and change the font manually. To change the font for all new text boxes all you have to do is first create a new text element. Pick your font, and finally go to format -> Advanced -> Define Text for all Masters.

I was honestly about to throw keynote out the window until I discovered this.

See it Live

Designing a presentation is only half the battle. The actual speaking part is what most fear. I have seen surveys where people say they would rather die than speak in front of a room full of people. I think that is a little extreme but everyone has their quirks. On a positive note if the talk bombs you can always share your beautiful slides and people will think you did an awesome job. 🙂

If you want to see my finished presentation there is only one way. Attend the first ever laracon. It should be loads of fun and nice to finally get to meet a lot of the Laravel community. I want to give big props to UserScape for getting the ball rolling on this.

My 2012 – A look back

This past year has flown by and it is really hard for me to grasp that it is already 2013. As I sit here and look back it has been a wild ride for me and I wanted to write a post covering some of the big things that happened in my life both personally and professionally.

New Job

Back in January I took a new job working at UserScape. In hind sight this was an awesome decision. I not only work with two of the smartest guys I know but UserScape is an awesome employer.

New House

A week after starting this new job I bought a new house just a few miles down the street from where I had been living for the past 7 years. It was a foreclosure and they had a front porch auction. That was my first experience in an actual real life auction with big numbers. Luckily we were able to get the house for a good deal even though we went over our initial budget. If you have never been in an auction and it’s easy to get wrapped up in the moment.

After a very short few weeks we had finishing the closing process and decided to fully go through the house and paint, fix any issues, and get it perfect for when we actually moved. My wife knew that if it wasn’t done before moving then it would never get done. 🙂 Looking back that was a great decision and I couldn’t have gotten finished without the help of my family. There is a reason I work on the web. Painting is horrible, fixing things is horrible, moving is horrible.

One of the perks with this new home is the neighborhood has a pool. So we spent most of the summer swimming and meeting neighbors. Having an employer that offers summer hours is awesome. All this time at the pool did have a positive side effect though. I wasn’t happy with my weight and going to the pool every day made me realize I needed to start exercising.

Losing Weight

In July I decided to get serious about my weight. After researching various diets I settled on just eating less calories. I love sweets and I wasn’t willing to give those up. So I tracked my calories everyday, stopped drinking sodas, and started eating less during meals.

Men or women who are 5 feet 4 inches tall would have “normal” BMI if they weighed between 108 and 145 pounds, for example, and overweight if they weighed 146 to 174 pounds, and obese if weighed more than that.

Next I got my mountain bike out and started riding again. It had been a few years since the last time I rode and I had forgotten how fun it is. I was able to ride close to 100 miles before it got to cold and the time changed. With both riding and calorie watching I was able to go from 172 down to 150.

Just because of the changing seasons I didn’t want to stop losing and in December I started the Insanity workout program. Currently I am down to 144. My original goal was 155 but now I am thinking 130’s.

Work

Work wasn’t slow either. One of the first projects I did was build the simple Laravel Bundle site and convert a design Fixel created into the Laravel site. This was all easy stuff but got my feet wet in Laravel after using CodeIgniter for the past 6 years.

From here we started a new project which later was put on hold and instead it turned into Snappy. Originally we never planned for it to look or work as it does today. It was going to be more a traditional app with some ajax interaction thrown in.

From all of our ajax discussion I started researching JS frameworks and settled on giving knockout a spin. At first glance it seemed to fit with our goals but after a short time I wasn’t really happy with how it was all working. At this point I found BackBone and jumped in to learn it.

I will be the first to say that I have been complacent over the years when it comes to JS and it was never a strong suit for me. Sure I could integrate a jQuery plugin, write some simple stuff, but never dreamed of building anything substantial. So going from pretty much nothing to a giant single page application was a huge learning experience for me. I can’t count the number of days I stayed up to ridiculous hours reading, practicing, and learning.

After a month we had a working wireframe working and then FocusLab was brought in to handle branding and design. As you can imagine the app at that point took another 180 degree turn. As a developer you always hate when that happens but you have to look at the end goal. You have to WOW your customers.

Now it is the end of the year and Snappy is in private beta with lots of goodies in the pipeline before our official launch. It is the classic software design issue where the last 10% takes 90% of the time.

Blogging

Benjamin Franklin once wrote, “Either write something worth reading or do something worth writing.” Seeing as I haven’t done the latter I am going to try and write something worth reading. I have put together a new design and plan to write longer article style posts and tutorials this year.

Statamic Email Form Plugin

This is a plugin for Statamic that is designed to allow you to quickly and easily create email forms. Currently it is pretty basic but flexible so it should be a great starting point. I hope to get feedback on this release and then make improvements over time.

Installation

Copy the “email” folder to your _add-ons directory.

Example Form Template

Here is a full example to get you going. Please see the parameters section
for more field options:

{{ noparse }}{{ email:form subject="Contact Form" to="eric@ericlbarnes.com" required="name" }}
    {{ if error}}
        <h1>Error</h1>
        <ul>
        {{ errors }}
            <li>{{error}}</li>
        {{ /errors }}
        </ul>
    {{ endif }}

    {{ if success }}
        <h1>IT WORKED!</h1>
    {{ else }}
        <p>
            <label for="name">Name:</label>
            <input type="text" name="name" id="name" value="Bill">
        </p>
        <p>
            <label for="from">Email:</label>
            <input type="text" name="from" id="from" value="test@test.com">
        </p>
        <p><input type="submit"></p>
    {{ endif }}
{{ /email:form }}{{ /noparse }}

Parameters

The {{ noparse }}{{ email:form }}{{ /noparse }} tag accepts the following paramaters:

  • subject: The subject of the email.
  • to: The form recipient’s email address.
  • cc: A cc email address.
  • bcc: A bcc email address.
  • required: A pipe seperated list of required fields. Example: “name|address|city”. Currently this only does simple validation to check if it is an empty value.

Issues / Gotchas

The name field is hard coded as the reply name in the plugin so it is recommended you use this field in your form.

Contribute

Keep in mind this is the first release so if you see any issues or have ideas for improvements pull requests are gladly
accepted. 😉

Download

You can clone the repo by running the code below:

$ git clone git@github.com:ericbarnes/Statamic-email-form.git

Or visit the GitHub Repo.

Statamic Sitemap

This is just a few simple template files to generate a sitemap of your site for submitting to Google webmaster tools. It follows the sitemap protocol.

Installation

Copy the contents of all the directories and move them into your Statamic site.

Download

You can clone the repo by running the code below:

$ git clone git://github.com/ericbarnes/statamic-sitemap.git

Or visit the GitHub Repo.

Statamic

If you have followed this blog over the years you know I am always changing something. So this may not surprise you that I have switched blog platforms, again. I had been using Tumblr which is perfect for my normal posting routine. Sharing quick links, photos, quotes, and occasional articles. As much as I liked Tumblr some things just irked me.

  • They control your data
  • No easy way of setting up redirects in bulk
  • No importing

Mainly the control of my data is what I didn’t like. I want all my content stored where I can do what I want with it. Of course, they do offer an API but what if one day they stop providing it?

I did have a short stint of using kudos which is a flat file Laravel app created by Ian Landsman and it worked great for me. Except for one major drawback. You still have to open your editor and write the post and then push. Just too much work for me and my number of posts went down considerably. I guess I am just lazy 🙂

A few weeks ago I came across a new cms named statamic and quickly applied for the beta. I ended up getting just before it was officially released but had enough time to play with it and enjoy how they set up the system. Everything is stored as flat files just like the jekyl flavor. But with one huge difference and that is the ability to post from an admin section. Which still just creates flat files.

So now I can post quickly from the admin and later on when I feel like it sync with git so I have a full off site backup of all my posts. Even though the cms is pretty basic the possibilities are pretty much limitless with what you can do with it. For instance, I have duplicated my whole Tumblr setup with it. Now I have all four post types and it really wasn’t much work. Just a few hours over two evenings.

Statamic is commercial but the pricing is very fair and I don’t mind paying for something top quality with support. All my little questions have been answered quickly and with a good answer. So yes I fully endorse what they are doing and excited to see them grow.

I will miss the Tumblr followers, but I always have an rss feed you can use to keep up to date 😉

Hosting

Another negative is hosting. With Tumblr it is free and well you can’t beat free. I tried aws but it was to expensive for me. I am outside of my year free micro and it seemed like a micro was running around $30 a month. I started researching other hosting options and was going to go with a shared system but meh. I would rather have full access to do whatever I want. After browsing what felt like weeks I settled on Linode and was lucky enough to get in when they offered a $100 credit. Woot. 🙂

So now this site is running on Linode with Ubuntu, Nginx, PHP5-fpm, and apc. All data is stored in a private git repo at BitBucket.

CodeIgniter Security Basics

By default CodeIgniter is a very secure framework and it also does a lot behind the scenes to help you out. I was recently contracted to look over a CodeIgniter application that was constantly getting hacked. So in light of what I seen I want to share some common pitfalls you need to avoid.

  1. Use Active Record! You should “almost” never write your queries manually.
  2. If you must write a query without active record be sure everything is escaped properly. $this->db->escape()
  3. Validate user input! CI has $this->input->post(), $this->input->get_post() and you should use those.
  4. Validate file uploads and use the upload library.
  5. Use the framework tools. It comes with tons of libraries and helpers that are designed to help you with common tasks. There is no reason to write
    your own if already accomplishes what you need.

Yes I know every php developer should know about these but some people still just haven’t gotten the memo. So spread the word, write secure apps, and make the world a better place.

Atlanta PHP Meetup

I had the pleasure of attending the Atlanta PHP’s meetup on Thursday at StrongBox West where Ben Edmunds gave a talk about the Laravel framework.

Doug Grubba and I decided to carpool down since Atlanta1 is about 4 hours from Charlotte. I will be totally honest I really didn’t have high hopes on how the meetup would go. I have been to some local meetups and I was just not that impressed. Low turnout, weird locations, etc. But Chris Spruck and the ATL guys are top notch. They had a lot of great sponsors, food provided, free prizes, and above all a nice turn out. (I estimated about 50 people).

After the meeting a few of us went over to local pizza shop and talked about all sorts of web topics and where our next stop in hotlanta should be.2

I had a wonderful time and wished I lived closer so I could attend more of their meetups. They get two thumbs up from me and hopefully I will get to visit again.


  1. Photo by tableatny 
  2. Ended up going back to the hotel and watching some gator hunting. But hey my wife is happy about that. :) 

Summer Hours

In all my work history I have always had a 5 day work week. Either Monday through Friday in the IT field or Tuesday through Saturday in retail. I am working at UserScape now and we started summer hours two weeks ago. Which basically means we get half the day off Friday.

Honestly going in to the first week I was a little worried I wouldn’t get as much accomplished as I wanted. Now that we have passed our second week I think I get more done on Friday than some of the other days. My mind shifts from thinking about what I can get done by the end of the day, to what can I get done in the next 20 mins. Friday mornings feel like a sprint and I am focused on getting as much done as possible. This means I take away as many distractions as I can. (rss, email, im, etc)

Not only do I feel very refreshed coming into Monday and ready to jump in but that extra time with the family is awesome. I don’t know about your weekends but mine are so crammed full of activities it goes by really really quickly.

If you are an employer I would recommend you give something like this a try. You may find your employee moral improves and more things get done in less time.

Cheating Or Good Design?

A comment on Reddit (by raygundan) points out an interesting technique Apple uses on their iOS platform:

when you switch apps, the device saves a screenshot of what the last screen looks like for that app so that when you switch back again, that saved screenshot is the first thing you see. This is done to buy time for the app to fully load. Instead of showing you a blank screen or a loading screen, the device shows you a screenshot of the app. This technique works because the time it takes to load the rest of the app isn’t very long anyway, so a second of showing a screenshot that the user cannot interact with doesn’t cause confusion. What it does do is make it looks as if the app has loaded instantly, which results in a very good experience for the user.

I think this is a brilliant idea. It seems we live in a world full of loading gifs and I appreciate fine details like this. The fine details that you don’t see is the difference between mediocre and extraordinary.

Laravel Blade

Blade is the simple template/theme system built into Laravel and up until this point it has been very basic. It supported most of the simple things such as variables {{ $var }}, @if @else, @section, and finally a thing called @yield.

Because of the simplicity of it on a new project I thought we would need something more advanced and went with Twig. Twig had more features and was more powerful but it also didn’t really fit into my workflow. The biggest problem was working with Eloquent results and twig doesn’t like calling results like this:

foreach (Book::with('author')->get() as $book)
{
    echo $book->author->name;
}

I asked Taylor about it and he did a few changes to get that working but then I had troubles with other calls. So it just felt like it was more of a fight than what it was worth. After discussing this, last week Taylor and Shawn McCool really made Blade awesome. First Shawn recommended a “render_each” method. Which is an excellent feature in my opinion. It works my including a looped view:

<ul>
    {{ render_each('categories.list', $categories, 'cat') }}
</ul>

// categories/list.blade.php
<li>{{ $cat->name }}</li>

As you can see that is a big time saver. But it doesn’t stop there. Now Blade can have layouts inheritance and several other really useful goodies:

@layout('layouts.common')

@section('content')

    <p>My content</p>

@endsection

Then inside layouts.common:

<html>
<head>
    <title>Test</title>
</head>
<body>
    @yield('content')
</body>
</html>

This is just some of the basics of the new features and it does a lot more. Although I don’t consider it a full replacement for Twig it has 90% or more of the features I wanted to use. The biggest missing feature (depending on your needs) is that Blade still just parses as php. So it can call things that are not assigned and doesn’t prevent you from using php code in your views. Personally I like that feature but if you are really wanting to limit what people can do in the views then this may not be ideal. So use what is best for the task at hand.

For a video overview of what is coming please watch this:

http://www.screenr.com/embed/ft28

Laravel Bundle Assets

The past few weeks I have been building a few Laravel bundles and one of the features of bundles is the ability to have assets that are moved to your public folder during install. This is great when your bundle has css, js, images, etc..

The downside to this though is that while building the actual bundle it is a pain to keep having to run the following command each time you change a file:

php artisan bundle:publish

I have came up with a few different options to make this easier for developers. The first method which I believe would be supported across every os is to symlink the assets to public/bundles/folder/. However the down side to this is you have to add new symlinks when you add new files. So not ideal for the way I typically develop.

The second option is specific to mac but it works wonderfully. What I have done is purchase live reload and use it to run the bundle publish command. The reason I originally purchased the app was because I am using less for my css and I liked the fact that it would compile the css and also refresh your browser so you can see changes instantly.

The bigger benefit is live reload allows you to run terminal commands after you save and before it refreshes your browser. So all you have to do is add in your artisan command and not have to worry about it again. Here is a screenshot showing this:

livereload

Hopefully this will help you if you are building bundles with public assets. If you have any other tips please post them in the comments.

Laravel Log Viewer

A simple Laravel bundle to display your log files via the browser.

Installation

php artisan bundle:install logviewer

Publish assets

php artisan bundle:publish logviewer

Then edit your application/bundles.php file and add:

return array(
    'logviewer' => array(
        'location' => 'logviewer',
        'handles' => 'logviewer'
    )
);

Download

You can clone the repo by running the code below:

$ git clone git://github.com/ericbarnes/Laravel-Log-Viewer

Or visit the GitHub Repo.

New Laravel Bundle App

Since starting at UserScape I have been tasked with building a new bundle application for the Laravel framework. So far all the work has been done “behind the scenes” but I wanted to share a few screenshots of what I have completed so far.

bundle-home

This is a temporary home page which showcases the latest and the most popular. Currently the most popular will be determined by number of installs but I have some ideas for better stats and filtering that will come later.

bundle-user

This is the grid list. I tried keeping it simple so you can quickly scan the titles and also show each users gravatar for branding.

I am really happy with what I have completed so far and it should be a simple and effective way for users of the framework to find pre-built code to put in their applications.

If you are interested in seeing how to create a bundle check out Taylor’s Videos

CodeIgniter Output Caching

This week I had the privilege of doing load testing on an aws setup. The goal of the test was to support 25k concurrent users and was designed to ramp up over a period of a few minutes. The first round of testing failed pretty quick and I only had a select number of large queries cached. So the db spiked and was the bottle neck. During that test we was only able to reach 10k concurrents.

For the second round of testing I decided to just setup output caching before I even loaded the db in a MY_Controller. I set the number of minutes to something relatively high and was ready to commence the load test. Unfortunately this test maxed out the db again and I was honestly scratching my head on just why that would be the case.

Since this didn’t make any sense to me I decided I better figure just what is going on. I got my local system setup the exact same way, enabled mysql query log, and then proceded to test and see what was going on. Queries was being ran even after the cache file was written. At this point it was way late so I decided I better sleep on it and try and think about what I was missing.

The next morning I got to work ran the same tests and got the same results. Starting researching and then realized it was just my ajax calls that was generating the queries. This had me puzzled because the ajax controller extended the MY_Controller so it should be cached as well. Turns out I was wrong and missed the most important note in the user guide:

Warning: Because of the way CodeIgniter stores content for output, caching will only work if you are generating display for your controller with a view.

The more I thought about it the more sense that makes since the Loader ties into the output library but I wasn’t thinking clearly at 3am. Looked at my ajax controller and sure enough I was just returning a json string.

return json_encode($vars);

The quick fix was to change the return to the following:

return $this->output->set_output(json_encode($vars));

My hope is this will help others if they ever run into the same situation. Unfortunately the load testing was only scheduled for two rounds but I feel confident by fixing that it would have passed with flying colors.

So the moral of the story. READ THE MANUAL 🙂

New Year, New Job, New Framework

I am happy to announce that starting January 9th I will be working full time for Userscape. If you are not familiar with them they are the company behind the awesome HelpSpot help desk software.

Laravel

Not only will I be a part of a great company but they have also hired the creator of the Laravel framework, Taylor Otwell. I have been watching that framework closely the past few months and I am very impressed with what he has done with it. Laravel’s motto is:

Laravel is a clean and classy framework for PHP web development. Freeing you from spaghetti code, Laravel helps you create wonderful applications using simple, expressive syntax. Development should be a creative experience that you enjoy, not something that is painful. Enjoy the fresh air.

The simplicity of framework is what drew me in originally. But now it will just keep getting better and better because it will be the framework of choice for Userscape. The reason I feel this way is that HelpSpot can be purchased as either a downloaded application or hosted with their partner Engine Hosting, so Laravel will be tested in a wide range of different hosting environments.

CodeIgniter

Even though my day job will be with Laravel I still love CodeIgniter and I am still on the CodeIgniter Reactor team. CodeIgniter is and has always been near and dear to me and I really enjoy using it. Plus I will be doing contract and freelance work for companies that are heavily invested into it. I am very excited with where CodeIgniter v3 is heading and I think it is a big step in the right direction that we have all been wanting.

My Top Mac Apps of 2011

I always like reading lists of apps that developers use on a daily basis and I love finding ones that I have never heard of or never gave a chance. As 2011 comes to a close I wanted to share my favorite apps that I use on an almost daily basis.

CodeIgniter

Not a mac app but still the framework I use every single day and write posts about all the time. 🙂

Alfred App

This is a must for every computer that I own. I love the quick application launching, calculator, and custom commands you can use.

Sparrow

Previously I was using just the standard mail app but when 10.7 came out I really disliked it. So I found Sparrow and have been happy ever since. It is nice and light and does just enough for what I do.

Git-Tower

I don’t always use a git gui, but when I do I choose Tower. I like the quick visual diffs and the clean layout. Another great git gui is gitbox which I use as well.

Mamp Pro

I use Mamp Pro just because it is easy. I like the fact that I can setup vhosts through a gui and not have to worry about installing apache, php, and mysql. Another benefit is that I work with a bunch of designers and with us all using Mamp I know what I build will run on their systems with out me having to do anything.

Sublime Text 2

This is my code editor of choice right now. It is awesome and you should try it if you haven’t. More Sublime Text Posts

Fake App

I found this a few months ago and it is really great for browser testing and inspired by Automator. So it is really simple to setup and use.

nvalt

I use this every day to create notes, ideas, and write out features before starting coding. I have this setup to sync with dropbox so my notes are always available. More Tips

Sequel Pro

I have to connect to several dbs throughout my day and this app makes managing mysql a breeze.

CoRD

CoRD is a Mac OS X remote desktop client for Microsoft Windows computers using the RDP protocol. At work we have a lot of old legacy sites that are running on windows hosting and I really like this app because of its speed compared to others I have tried.

Common Ones

For other common day to day applications I use Chrome as my browser, iChat, Textual IRC, dropbox, and Feedly for my rss feeds.