CodeIgniter Startup Script
February 24, 2012
Ever since CodeIgniter moved over to GitHub I’ve been interested in figuring out a way to use the EllisLab repository code inline with our specific project code to simplify updates but haven’t found a great way to go about it.
Fairly recently I came across CodeIgniter Starter which is a step in the right directoin: A GitHub repo that has some configuration and project setup in place. I didn’t love that it comes with certain Sparks pre-installed and at Bold we run our system files outside of the webroot. Still left me with a decent amount of configuration to get up and running.
I use Sublime Text 2 for coding (you probably should be using it too) and recently there was a great Package built by NetTuts called NetTuts+ Fetch. It simplifies the retrieval of remote files and packages by downloading them from a preset source and “injecting” them into a project. It got my juices flowing again about automating CodeIgniter project setups.
Enter Bash scripting. I’ve always loved Bash scripts and realized that this was the perfect use case. Let’s automate all of the steps and configuration that happens on every new CI project with a short command line operation.
As I mentioned, at Bold we run CI system files outside of the webroot. This script retrieves the latest CI version, automates the clean up of the folder structure, installs placeholder asset files, and optionally sets up the Sparks installer (no actual Sparks are installed), adds the project to a local Git repo, pushes the initial commit to a remote Repo, and installs Git Flow. Lots of stuff going on there, but now deploying a new CI project takes about 10-15 seconds from start to finish. Pretty great!
Check out the code and full docs on GitHub at: https://github.com/gstjohn/codeigniter-startup-script
CodeIgniter Spark for SendGrid’s Newsletter API
February 16, 2012
I’ve submitted my first CodeIgniter library to GetSparks.org in an effort to start giving back to the community that has provided us with so many great tools. This library is a wrapper to the SendGrid Newsletter API and supports all of their provided methods.
What is SendGrid?
SendGrid is a easy-to-use email delivery service similar to Postmark or Amazon’s SES. They provide a great way to send transactional emails using CodeIgniter’s core email library and SMTP. However, they also offer a newsletter service at no additional cost which supports recipient lists and send scheduling.
Where Can I Get It?
CodeIgniter US State Helper
August 11, 2011
I’m working on a project today and building a credit card checkout form for what seems like the 1,000th time. It occurred to me that a US State Helper would save me from having to 1) look up all of the states every time, and 2) dump them into an array and build out functions for easy conversions and validation. I figure this may help some people out there, so enjoy!
If you are using the Spark, install as usual. Otherwise, the helper file (helpers/state_helper.php) will need to be moved into your ‘application/helpers’ project directory.
No configuration involved. Just load the helper as your would any other helper.
<?php // Spark $this->load->spark('state-helper/1.0.0'); // Or, Helper file $this->load->helper('state'); ?>
There are currently four helper functions available to simplify dealing with US states in CodeIgniter.
- state_array() — Returns an array of US state names where the array’s keys are the corresponding two-letter abbreviation.
- state_dropdown($name [, $selected [, $id [, $class]]]) — Returns the HTML for a <select> dropdown where the <option> values are the states’ two-letter abbreviations and the displayed values are the full state names.
- $name — The name to be placed on the <select> element.
- $selected (optional) — The particular state’s two-letter abbreviation to be set as the default.
- $id (optional) — ID attribute to be placed in the <select> tag.
- $class (optional) — Class attribute to be placed in the <select> tag.
- abbr_to_name() — Converts state’s two-letter abbreviations into their full state name.
- name_to_abbr() — Converts full state names into their respective two-letter abbreviations.
- is_valid_state() — Checking function to see that the provided full state name OR two-letter abbreviation is valid. Returns boolean TRUE or FALSE.
Why I Quit Gowalla
April 26, 2011
Let me start by saying that I deeply respect the team at Gowalla and actually envy their fun work environment and exceptional level of talent. This post is to address the service they’re building, not the folks behind it.
Up until today, I had been a member of Gowalla for something like a year. I was immediately drawn to the service because of its ability to locate me, find the business I was present at and commit a check in. The iPhone and web interfaces are simple and beautifully constructed.
I quickly invited most of my friends who proceeded to sign up, making the experience even more entertaining. I checked in everywhere I went, from gas stations to my polling place. I took pictures, reported issues, and even gave feedback on the Gowalla GetSatisfaction page. I would consider myself to have been an active member of Gowalla.
Unfortunately, that was the peak of my experience and it was a slow downhill from there. There are several key places where I feel Gowalla is lacking and keeping themselves from being sustainable for the long run.
I’m not sure I ever really understood what the driving force was behind me wanting to check-in everywhere I went. Most of the time the actual check-in was the end of the road. Phone away and on with other things. I liked being on the Leaderboard at the few places I checked into regularly, but that wasn’t permanent or overly hard to attain.
Locations, check-ins, and items need some incentive behind them (whether physical or virtual) to really be interesting after the newness wears off. There are plenty of ways to implement incentives, but I don’t think anyone (Gowalla, Foursquare, etc.) has really gotten it right.
One of the first things I noticed when joining Gowalla was that basically none of my friends were on it yet which seemed reasonable since it’s a newer start-up and isn’t widely adopted. I invited quite a few people and even gave several friends a face-to-face walkthrough on why they should check it out (sidenote: shouldn’t there be a pin for accepted referrals).
Having a few people I knew well on the site made it much more interesting, but it never became more than, “Oh, he’s at Taco Bell again?!” or “I guess he just made it to work”. There is no sense of community and tends to feel more like a “people tracker” than networking medium.
In an effort to build community and interact more with the service, I added most of the people I follow on Twitter as friends on Gowalla. It quickly became obvious, however, that doing that is less than desirable.
I found I’m not all that interested in people’s check-ins when they live 2,000+ miles away. I’m also not interested in places I’ve never heard of or have no plans to visit. Most of the time I just turned off their Push Notifications, but then I had to ask myself what was the point of following them in the first place?
Almost any time I met with someone for lunch or coffee, I made sure to get my check-in settled before jumping into conversation. It didn’t take long to realize how this was a totally ridiculous practice. Why was I de-prioritizing my friends and family so that I could let the world know where I was?
The same question could easily be asked of Twitter, Facebook, and SMS, but the reason I am OK using those is because I feel like there is a community of people (see “Community” above) on the other end with which I’m sharing my life and continuing to grow our relationships. That’s not so much the case for me with Gowalla.
Checking in to find that you’ve received a new item is definitely fun. I also really liked exchanging items at a location and tracking the history of where they’ve been. So, now what?
I can see collecting items and putting them in my archive as a goal. Most of the time, however, I just dropped them somewhere for someone else to pick up. I never felt satisfied with item collection alone being the end goal of my Gowalla experience. I liked finding new locations and becoming the creator, but what’s the incentive? Eventually, I earned a pin or two for creating Spots, but is that it? I never once looked to see what pins other people had earned. Pretty consistently I found myself needing more direction on what to do next. What’s the next achievement? What am I getting out of this? What do you want from me, Gowalla? If the service can be whittled down to sharing where I’m located, I’ll elect to simplify and just add my location to a Tweet.
This post is in no way meant to flame Gowalla or the great people that work there. I just need more from the service to justify continuing to invest my time in it. I think there are loads of opportunities (of which I’m sure they are working on some of them), but for now I value simplicity and privacy just a bit more.
Making the iPad into a “Laptop Killer”
April 18, 2011
I’ve been using my iPad 2 for just over a month. I pulled the trigger and bought it with the expectation of using it primarily for reading (Twitter, RSS, Instapaper, Bible, Kindle). While that is mostly true to this point, I find myself wanting to use it for more. I find myself wanting it to replace my MacBook Pro, but can’t quite pull the trigger. Here’s why:
The Inability to “Create”
I’m not looking to edit Photoshop files and, frankly, I don’t even want to edit videos with the new iMovie app. Those things should be done on a computer with a mouse and keyboard, but I feel there are a few significant barriers blocking the transition from consumer to creator on the iPad.
As I mentioned in my last post, it’s not possible to do something as simple as add an attachment to an email within the Mail app. That’s just not acceptable from a device that would replace my laptop.
Let’s be honest, there is no printing support for the iPad.
I know there’s AirPrint, but should I have to buy an HP printer? I already have a Brother printer that I love. I understand that Apple doesn’t want to mess with the thousands of different printer drivers out there (Trust me, I used to be a Linux-only guy), but isn’t that just a bit of a cop out?
There are also printing apps in the App Store. I haven’t tried them myself, but the reviews are very mixed. I have to believe it’s a bit of a kludge if it may require me to install software of my desktop computer to make it work.
I don’t print a ton even with my desktop or laptop, but when I need to it’s usually for a good reason and I need it now (concert tickets, receipts, meeting notes).
No Personal Storage Area / Home Folder
I would like to have a home folder that serves as a place for file storage. There are currently various apps that facilitate that storage (both locally and in the cloud) like Photos, Dropbox, Evernote, and GoodReader, but why not natively?
Common Data Storage Area
I’d like to have an area where I can dump a file and not require an Internet connection to access it. This folder would also serve as a common storage area where other apps could source files (much like Twitter and the Photo Library do now). For example, I’d like to download an image from a website and upload it to Twitter or send a stored Word document to someone through Skype.
Replace the USB Drive
When I plug in my iPad to a computer, it should mount like a USB drive. Loading or unloading the iPad should be as simple as drag and drop…no iTunes required, please.
This would allow a person to work on the file at their desk, load it up on the iPad at the end of the day, compose an email on the train ride home and send it off as an attachment. That easily matches the convenience of a laptop.
Although not at the top of my list, the iPad should have user accounts. Here are some cases where it would be nice:
- Perhaps my wife doesn’t want her apps arranged in the same manner as I do. Maybe she doesn’t want an app to show up on her screens at all. My wife uses the iPad entirely differently than I do.
- Two different people usually have different email accounts and mingling the two gets messy and confusing. I’d prefer separate instances of Mail.
- Maybe I don’t want to get work emails over the weekend, and likewise don’t want to be distracted at work with Push notifications from Word with Friends that remind me of the slaying Chris Bowler is administering.
- I’d like to play Angry Birds and beat all the levels myself, but am forced to share with our friends 5 year old who is giving me a run for my money.
- All apps with personalized logins require using shared accounts or logging out and back in each time a new person uses the iPad. Way too much hassle!
Is Apple telling me that my wife and I both need our own iPads? Perhaps. At their current price point I can get three or four iPads for the price of one MacBook, but then of course I’d have to buy all the apps twice. “They’re only $0.99,” you say. Unfortunately, that doesn’t hold much weight with the guy that will make a U-turn for the gas across the street that’s 1 cent cheaper per gallon.
The bottom line is that I really enjoy the iPad and it’s great for most of what I do. I feel like for Apple to take it to the next level and rightly deserve the label of the “go between” device it has to function somewhat more like a laptop and slightly less like a smartphone.
I’d really enjoy hearing your thoughts and responses on Twitter. Hit me up @gstjohn.