10 5 / 2012
PHP Fedex Api - Another one to the horrible api list
So today I got the honor of working with the Fedex php api. After hours of hunt no one has built anything better. After reviewing it, i could probably consolidate these 80 Files, about 1000 Lines each page of code into 1 file under 2000 lines.. I think thats what ill just have to do.. Let me know if anyone has any other solutions.
Fedex.. a big boooo to you.. At least your documentation pdf isn’t so bad.. but couldn’t you have made the method names a little bit easier to get.
04 4 / 2012
tumblrbot asked: WHERE WOULD YOU MOST LIKE TO VISIT ON YOUR PLANET?
Australia, cant wait to go on the safari. Hopefully next year ill be able to go!
04 4 / 2012
Codeigniter code Tidy for Sublime
Coming from netbeans, I love the way it did code formatting, one of the biggest things I missed when I made the switch to Sublime Text 2. But then I found a repo that implemented PhpTidy and formatted the code for Wordpress.
https://github.com/welovewordpress/SublimePhpTidy
So I thought why not just make this amazing and add in a feature set to support codeigniter style guide as well.
https://github.com/chonthu/SublimeCITidy
Currently Ive added some styling, but its still in progress, the repo didn’t come with menu action or setting page, so I added the menu and setting pages for Sublime will be out in the coming week, if anyone has any “wishes” for the repo let me know.
Currently on the wish list is:
1. In the setting section allow for user to select from available styleguides for popular php frameworks.
2. Allow in settings to turn on and off options such of short php tags and new line brackets.
22 3 / 2012
Amazon Route 53 Adds LBR
Check out the original blog post at
http://aws.amazon.com/about-aws/whats-new/2012/03/21/amazon-route-53-adds-latency-based-routing/
These guys are on fire!
To see how it all works
http://aws.typepad.com/aws/2012/03/latency-based-multi-region-routing-now-available-for-aws.html
Enjoy!
23 2 / 2012
Codeigniter on_duplicate_update db function
So your using MYSQL for your new codeigniter app and you get to a point in the app where you need to do this.
So as show above, you check if a record exists, if it does you update, if not you insert. This is fast and easy correct? But what if you doing thousand of records and you need some help in performance. Well in Mysqli you have the ability to insert on duplicate all in one query.
Ok thats great, but how can we make this amazingly awesome in codeigniter?? Well its a pain in the ass. But its possible.
$db[‘default’][‘dbdriver’] = ‘mysqli’;
First since codeigniter doesnt allow up to extend the active record class you have to add this section to replace the exisiting section in /database.DB.php
Then once this is done, inside of your application core, youll need to add 3 files.
MY_DB_active_rec.php
MY_DB_mysqli_driver.php
and finally MY_Loader.php
And then you can use this like this
Enjoy. :)
Permalink 2 notes
27 1 / 2012
A CMS? A custom CMS? I just need a website.
So what is a CMS? CMS stands for content management system. When thinking about creating a website, choosing a CMS is very important. Not everyone is a software engineer and knows how to code up websites. There are a lot of tools on the internet which engineers have built to allow users to write information, this information is then turned into “website code” and then a website is created from that generated code. This tool is referred to as the CMS.
There are a lot of prebuilt CMS solutions out there, or you can have an engineer build you a custom CMS, molded to fit your needs. This is a very hard decision to make, choosing between a custom and prebuilt CMS. This decision should be made with the sole purpose for creating your website. If your going to choose a prebuilt CMS you need to fit into the following buckets.
1. Content (Blogs, News, Text based data)
2. E-commerce (Online stores, Auctions)
3. A little bit of both of the above with slight more flexibility.
Highlight’s of a CMS: Efficiency, Community, Upkeep
Some Popular CMS solutions for your bucket:
( Note that these suggestion are all written in PHP, a popular server programming language, which is one of the most commonly used in the world next to java)
If your in the Content bucket, then you’ll fit perfectly into Wordpress. Wordpress is a out of the box solution, that is free to download and install on top which ever server you will be hosting your website from. Wordpress usually comes with free out of the box themes and you can be up and running within seconds. Most of the time these themes are not as great so you might end up either paying for a theme or have a engineer develop a custom one for you. Wordpress is the most commonly used CMS in the world. If you can use Microsoft word, you will be able to use Wordpress. The learning curve is very small for Wordpress and it contributes to the reason why its at the top spot.
If you’re in the E-commerce bucket, then you’ll fit perfectly with Magento. Magento offers great tools for managing your products and your inventory. It is the best tool on the market for managing an online store. But most of the time, just managing a store isn’t enough, you need to be able to manage content and build custom features on top of the way the store works.
If your in the third bucket, you’ll fit perfectly with Expression Engine. Expression engine is a paid CMS. Expression engine comes with both content and e-commerce solution plugins bundled in. With a prebuilt CMS you are bound to what the CMS does. Most of the time it is very hard for developers to build on top of these products. Most state of the art CMS solution like the ones above, give a feature called (plugins) this allows for the community members to build extensions to the CMS to added additional functionality. This additional function however is still limited to the general audience and might not have every feature you wish to have.
Prebuilt CMS are usually “open source”, which basically means the code to make the CMS is released to the public, this allows for the community of developers to upgrade and built better feature and keep improving and building on top of the CMS.
So wow, you might be saying, why would I ever need a Custom CMS if there are already so many solution for my needs already made. Most of the time that’s all you need is a prebuilt CMS. All of the CMS solutions one can have an engineer try to build on top of, but because they where initially made for the “general” audience, most of the time the plugins is not as efficient or as custom as it could have been.
Custom CMS solution’s is for project out of the box that doesn’t really fit into the general use case of a prebuilt CMS. A custom CMS is used when one wants his/her website to be very defined to their organization. It is created for just what you need and not built with a million and one features.
With a custom CMS, it is usually mush more expensive than a prebuilt solution. Also because there isn’t a community for a custom CMS like a prebuilt, a lot for the feature cant simply just be added within seconds like a prebuilt CMS. Also because of this your CMS is not open source you have no community updating your CMS feature sets like a prebuilt CMS.
Most of the top fortune 500 companies use a custom CMS, they don’t want to “look like the rest”. Custom CMS allows for “custom” feature sets, defined to your needs. If you not in the top buckets, you cant use a prebuilt CMS. Your needs at that point are far greater.
So to paint a clear picture, lets use two use case study members and see why prebuilt or custom was their pick.
User 1 - John:
John is a well-established writer. He needs a website to be able to share his thoughts about his books and reach out to his readers and hear what they have to say.
John best bet, based on our buckets would be Wordpress. John pays an engineer for a custom designed and implements the site. He creates a blog and start receiving comments from his readers. John saved a lot of time and money and was up in about a week with everything he wanted to do online.
User 2 - Sara:
Sara is also a brand new writer. She needs a website like john to be able to share her thoughts about her book and reach out to her audience. Sara is a little bit more tech savvy than john and started creating digital eBooks which she wants to sell online and also allow her users to download right from her website. Sara also decides to use Wordpress. Sara pays johns designer friend to create her website and her website gets created within 2 weeks. Sara website however doesn’t have an online store yet and no downloadable feature. Sara decided to look for any community plugins to accomplish this with Wordpress. She finds a plugin to create a online store, it doesn’t look the way she wants it, and doesn’t function the exact way she intended. This custom secure downloadable book that allows for security locking on any file she uploads doesn’t have a plugin, she has to think about getting a engineer to build that custom, so she contacts a engineer and the engineer wont be able to build this because of the way files are stored in the Wordpress database the way she intended to have done. If this were a custom CMS project, this feature would have been built without any issues.
Usually speed and optimization is a huge factor when considering a custom solutions. Most wordpress sites reply heavily and alternative-caching mechanism to speed up website because of the amount of feature sets it needed to have to handle “every general situation”.
As stated above, the decision between choosing custom CMS and prebuilt CMS is really based on your website needs.
26 1 / 2012
Sublime Text 2 and Nodejs
Just found an amazing plugin for nodejs for my favorite editor sublime text 2, make sure you guys all check it out, come with a lots of autocomplete options, hopefully they upkeep it through all the new node js versions.
24 1 / 2012
Node.js and ejs
So I been working with node.js for about 3 months or so now on a new project and I started out use swig.js as my templating language.
Swigs syntax will be very familiar to you all if your used to using twig for php and especially python Django’s templating language where pretty much everyone got their ideas from.
{% extends "base_generic.html" %}{% block title %}{{ section.title }}{% endblock %} {% block content %}
You can do cool things with this style templating language, especially my favorite, filters
{{ story.headline|upper }}
The above will turn the dynamic value of that variable to all uppercase case letters. Cool eh? The only problem is that swig doesnt really come out the box for expressjs. I got it to work but it doesnt really play too nice, especially when it comes to development. Testing code is not so great when having to restart the application everytime when making html edits.
So Ive turned my energy to EJS. Which if you looked at my packages blog you can just require(‘ejs’) in your dependacies and add
app.set(‘view engine’, ‘ejs’);
to your app.configure(); function for expressjs. Now your all set and ready to use it right out of the box for expressjs. If you want to start playing around with ejs and see how cool it is, visit thier website and checkout the live editor at
It doesnt have all the cool features of the polished Django framework, but with cool features like the json live update, it really fit perfectly for my node.js app. It also is sooo micro compared to a lo templating t of other engines out there. Hope you guys check it out and let me know what you all think.
19 1 / 2012
AuthorsAlley.com

Super excited to reveal that my Authors Alley project is now in beta! Show your support and sign up today for the free account. Please note im still working on the help docs and the advanced billing areas. Thanks for the support!
Permalink 3 notes
15 1 / 2012
Node Package.json
Node handles dependencies pretty cool, within your node application go ahead and add a file called packages.json
Once this file is created go ahead and paste this sample inside
{
“name”: “Sample Project”,
“version” : “1.0.0”,
“description”: “Need Dependancies”,
“author”: “Your Name”,
“dependencies”: {
“express”: “2.5.6”,
“express-mongoose”: “0.0.4”,
“swig”: “0.8.0”,
“socket.io”: “0.8.7”
},
“engine”: “node >= 0.4.12”
}
Now if you have npm installed with node, open your console to your in the app folder and type
npm install
By doing so, npm will install all the packages within the dependency list, for more info, check our the official npm site