brandontreb.com Tips And Resources For Software Consultants

Link: Minecraft Like Rendering Experiments in OpenGL 4 – Codeflow

I found this article while browsing reddit and was blown away. I have been a little mystified at the potential algorithms used by notch to render the terrain in Minecraft.

This provides a killer explanation of some interesting algorithms that can be used to generate such worlds. It also contains the source code that you can download and play with.

Minecraft Like Rendering Experiments in OpenGL 4 – Codeflow.

Creating A Twitter Client For OSX – Part 1

With the upcoming release of the Mac App Store, I can only imagine another gold rush is upon us. Clever Indie developers making money hand over fist while the store as well as developers find their identities. With that being said, I feel that there is a serious lack of interesting (maintained) Twitter clients for OSX. I say “maintained” because Tweetie for OSX is just fantastic, however Twitter said they don’t have any plans for it at this time. So, I want to provide devs with the tools to create an amazing Twitter client for the Mac that I will want to use :)

Quite some time ago, I began (and never completed) a series on writing a Twitter client for OSX. It was very well received by the development community, however once Twitter switched over to OAUTH, I became too lazy to update it :( . So, I figured a tutorial series for #iDevBlogADay would be the perfect opportunity to complete it.

So we are going to start from the ground up. In today’s tutorial, we are going walk through getting the initial resources and setting up Twitter to authenticate our application. We will also post a basic tweet.

Setting Up Twitter

In order for your application to interface with Twitter, you must register it with them over at http://developer.twitter.com.

  1. Go to http://developer.twitter.com and sign up if needed
  2. Click on Your Apps
  3. Click Register A New App and fill out all of the information about your client
  4. You’re all set!

Getting Necessary Resources

I spent a bit of time researching the various options for handling OAUTH and all of the fun stuff that goes along with Twitter integration and found that MGTwitterEngine was the least painful to implement. I say least painful because it has a few quirks of it’s own along with not having the best documentation in the world.

So after battling for a bit to get the thing compiled, I have figured out the setup process :). You could also read Matt’s installation instructions, but I will regurgitate them here a little differently and hopefully be more clear. So here it is:

  1. Make sure you have git installed. If not, download it for OSX here.
  2. cd to the directory that you want to clone the files to
  3. Clone the MGTwitterEngine repository. Type:
    $ git clone git://github.com/mattgemmell/MGTwitterEngine.git
  4. cd into the MGTwitterEngine folder (we will install the dependancies at this level)
  5. Now install the dependancies (TouchJSON and OAUTHConsumer). Note: There is an option to use yajl (yet another json library), but I found it a pain to integrate, so we will just throw it out.
    $ git clone git://github.com/schwa/TouchJSON.git
    $ git clone git://github.com/ctshryock/oauthconsumer.git

Altogether, this is the order of commands you should have:

<code class=’bash’>$ cd ~/Desktop
$ git clone git://github.com/mattgemmell/MGTwitterEngine.git
$ cd MGTwitterEngine
$ git clone git://github.com/schwa/TouchJSON.git
$ git clone git://github.com/ctshryock/oauthconsumer.git</code>

Building MGTwitterEngine (What a freakin pain)

I find it interesting that this project is riddled with errors directly upon download. So much work went into it, yet it’s so challenging to get working.

Now open up MGTwitterEngine.xcodeproj. You will notice that there are quite a few missing files (they show in red). That’s fine. DELETE THEM ALL…

  1. Delete the yajl group with everything in it
  2. Delete the Twitter YAJL Parsers group and everything in it
  3. Delete OAToken_KeychainExtensions.m and OAToken_KeychainExtensions.h (they are not used)
  4. Delete CJSONDataSerializer.h and CJSONDataSerializer.m
  5. Delete CSerializedJSONData.h and CSerializedJSONData.m
  6. Click the arrow on the OAuthConsumer group and you will notice that the Crypto is missing. We still need this group, but it’s in the wrong place. Delete this group and then open up your MGTwitterEngine folder in Finder. Navigate to MGTwitterEngine->oauthconsumer. Drag the Crypto folder into your project.
  7. We need to change the C Language Dialect to C99. To do this right click on MGTwitterEngine in XCode and click Get Info. Scroll down to C Language Dialect and click the drop down changing it to C99
  8. Finally, we need to tell MGTwitterEngine that we want to use TouchJSON instead of yajl. To do this open up MGTwitterEngineGlobalHeader.h and set TOUCHJSON_AVAILABLE to 1.
  9. If you still have any hair left at this point, click Build and Run to and check out the output in the Console
  10. If you don’t feel like jumping through all of these hoops you can download my MGTwitterEngine project with all of this fun stuff completed. Download it here.

Testing MGTwitterEngine

For today’s tutorial, we will just be displaying our timeline and updating our status using the demo file provided by MGTwitterEngine. In the next tutorial, we will actually be integrating the engine into a new project. So, open up AppController.m in the Demo group. Matt has given us some nice variables to fill in, in order to make this thing work. Let’s update to applicationDidFinishLaunching method to look like the code below:

<code class=’objc’>- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
        // Put your Twitter username and password here:
        NSString *username = @"brandontreb";
    NSString *consumerKey = @"aKKEsJHTDNsv4xVlMHmMqw";
    NSString *consumerSecret = @"oldpeoplenakedcriscotwister";

        // Create a TwitterEngine and set our login details.
        twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
    [twitterEngine setUsesSecureConnection:NO];
    [twitterEngine setConsumerKey:consumerKey secret:consumerSecret];
    [twitterEngine setUsername:username];

    token = [[OAToken alloc] initWithKey:@"16369316-GgqA00WO0poCAj0XAFhJYDDRthVvWMxTnVyKdfWa1"
                                  secret:@"StrongEnoughForAManButMadeForAWoman"];
    [twitterEngine setAccessToken:token];
    [twitterEngine getHomeTimelineSinceID:0 startingAtPage:0 count:20];
}</code>

So obviously I changed my consumer secret and Access Token Secret. You will need to fill this out with your information. Here is how to obtain them.

Consumer Key & Consumer Secret

When logged into http://developer.twitter.com/apps/ , click on the application that you created in the first step:

Scroll down and you should see the Consumer Key and the Consumer Secret.

Access Token & Access Token Secret

In the right column, you should see a link titled “My Access Token”. Click on it.

Now you should see YOUR Access Token and Access Token Secret

Have Fun!

After you copy the tokens, keys, and secrets into the app, you should be able start making calls to Twitter using the engine. Build and run the application at this point and watch your home timeline get output to the console. One thing I want to point out is we are displaying an NSDictionary. That means MGTwitterEngine did all of the parsing for us (using TouchJSON), which is super rad.

One more thing to try for fun is to update your status. It will even show that you updated it from YOUR application on Twitter. Add the following line and run it again.

<code class=’objc’>[twitterEngine sendUpdate:@"@brandontreb is a code gangster!  Check out his #iDevBlogADay post on making your own Twitter client here http://bit.ly/gGrZvI"];</code>

Well, that does it for today. Join me next week when I will show you how to move the engine into your own project and we will begin displaying tweets in a basic table view.

Happy Coding!

Click Here To Go To Part 2

—-

</p>

This post is part of iDevBlogADay, a group of indie iOS development blogs featuring two posts per day. You can keep up with iDevBlogADay through the web site, RSS feed, or Twitter.

</p>



</p>

Promoting Your Other Apps Within Your Apps

First off, Happy Thanksgiving to my American readers. And a happy Thursday to everyone else. I’m sitting here on Thursday morning drinking coffee and eating Sticky Buns (kind of like gooey doughnuts). It’s been a hectic week of family and travel, so please forgive me if this is not the most verbose post.

Showing your other applications within each of your applications (wow, the word application is starting to lose meaning) can have a tremendous impact on your sales. It’s a great way to promote your other apps for free and will give them much more exposure across a wider audience. Moving all of the promotion logic out to the web allows you to dynamically add and remove apps from the view without updating your apps in the store.

[Insert Cool Graph Backing This Statement Up Here] //I’m not that cool yet :(

We have seen this in many popular apps. Here is a screenshot from an iDevBlogADay veteran Owen Goss promoting his other applications from inside of LandFormer.

We are going to learn how to make something similar and I will provide you with a web template as well as the view controller to load it.

Download The Template

So, I’m sure there are a million more “elegant” ways to display your apps, but I went for super simple. So, 1337 web dev idevblogadayers, please go easy on me in the comments. Download the code below and look in the Web folder.

Download The Code Files Here

Here is a screenshot of what the template will look like:

It will also work in portrait mode.

Upload The Template Files To Your Web Server And Replace My Sample Data

If you have your own website (which you probably should 😉 ), upload the template files to a subdirectory. If not, or you don’t want to waste bandwidth on it, you can always host the files on Dropbox.

Next, upload your icons (the template auto rounds the corners so you can just use the one’s bundled with your app) and replace my sample images with yours.

Finally, replace the URL’s with the URLs to your applications. You can also add/remove table cells to match the number of applications you are promoting.

Add The Promotion Code To Your iPhone App

Look in the iPhone folder from the unzipped file you downloaded above and copy the following 3 files into your project:

  • PromotionViewController.m
  • PromotionViewController.h
  • PromotionViewController.xib

Check the box to copy them into your project folder when prompted.

We will now take a look at how to display the promotion view when a button is clicked.

<code class=’objc’>- (IBAction) moreAppsTouched:(id) sender {
    PromotionViewController *controller = [[PromotionViewController alloc]
        initWithNibName:@"PromotionViewController"
        bundle:[NSBundle mainBundle]];
    controller.promotionAddress = @"http://brandontreb.com/apps/idevblogaday/promotion.html";
    [self presentModalViewController:controller animated:YES];
    [controller release];
}</code>

Make sure you set controller.promotionAddress to the web address of your promotion.html file.

And there you have it! When the user tapps on a button it will display our promotion view modally and will load up your promo page. I have provided a sample application that pulls up the promotion view when a button has been clicked.

Download The Sample App Here

If you have any questions or comments, feel free to leave them in the comments.

Happy Coding!

—-

</p>

This post is part of iDevBlogADay, a group of indie iOS development blogs featuring two posts per day. You can keep up with iDevBlogADay through the web site, RSS feed, or Twitter.

</p>



</p>

XCode Tips And Shortcuts To Improve Your Workflow

Intro

This is my first #iDevBlogADay post and I wanted to give a quick intro before jumping in. My name is Brandon Trebitowski and I’m a software developer and author from Albuquerque, New Mexico. I graduated from the University of New Mexico in 2008 with a bachelors degree in computer science. For the past 2 years, I have been writing mobile applications (primarily for the iPhone) for ELC Technologies.

I also started http://icodeblog.com and currently write on it about once a month.

A Post On XCode Shortcuts?

Well, I’m sure by now, you have seen countless infographics and “cheat sheets” chock full of XCode shortcuts, tips, etc… These can be great resources, however, if you are anything like me, you see these, tweet the link, and move on never looking at them again. The only difference between these and the XCode key-bindings menu IMHO is a fancy background. So, I thought I would share some of the most important shortcuts that I have adopted to really improve my workflow. We spend so much time inside of XCode, it is worth the time to learn some of these.

Build Commands

By now, I would hope that you don’t click the “Build and Go/Debug” with your mouse whenever you want to run your application. If you do, no worries, here are some of the build quick keys.

**⌘ return – **This builds and launches the application in debug mode.
**shift ⌘ return **– Kills the running application in the simulator.
**shift ⌘ k – **Cleans the build target.
**shift ⌘ a – **Build and Analyze. This is quite possible the most important command to learn. This invokes the static analyzer to help spot memory issues in your code. Run this as early and often as possible.

My general workflow after writing a bit of code is to kill the last run, clean, analyze (hopefully not spend time on memory issues), and then build and debug. These 4 commands in sequence are much faster than searching out the menu items for each of those commands.

File Management and Navigation

Navigating around files is one of the most common tasks you will perform in XCode. It is really to your advantage to speed things up.

option ⌘ ↑ – This quickly switches between your .h and .m file.
**⌘ ↑ – **Move to the top of the file
**⌘ ↓ – **Move to the bottom of the file
**shift ⌘ d – **This was recently showed to my by @cruffenach and it has drastically sped up my workflow. This is the command for “Open Quickly”. It brings up a small window with a search box at the top. Typing in the box instantly searches your project and allows you to quickly open up files by pressing return on the selected file. I can’t believe I had been using XCode for so long before I found out about this command.

Binding Your Own Quick Keys

Some commands simply don’t have quick keys. For example, I constantly use the Edit -> Sort -> By Name command to sort my source files alphabetically. By default, you must click through all of the menus and select the command to get it to work. However, XCode (like most OSX applications) will allow you to define your own quick keys and here’s how.

  1. Open up the XCode Preferences
  2. Click on the Key Bindings tab
  3. Navigate to the command that you want to bind keys for. (hint: they are organized the same way they in the top menu)
  4. Once you have found the command, double click in the Key column
  5. Press the keys that you wish to bind (I bound option shift ⌘ s for sorting)
  6. If there are any conflicts, XCode will let you know. Otherwise, press apply and you’re good to go.

Wrap Up

Well, this concludes my relatively short first post for #idevblogaday. If you have any shortcuts of your own that you can’t live without, please share them in the comments. I’m always up to improve my workflow.

Thank you to everyone (especially @mysterycoconut) for allowing me to be a part of this community and I look forward to sharing my knowledge and experiences with you.

Happy Coding!

—-

</p>

This post is part of iDevBlogADay, a group of indie iOS development blogs featuring two posts per day. You can keep up with iDevBlogADay through the web site, RSS feed, or Twitter.

</p>



</p>

Core Data QuickTip: Inverse Relationships

One thing I always wondered about Core Data is why the compiler would warn you if you didn’t specify the inverse relationship. After reading through Apple’s docs, they essentially say its to make your database more robust by reinforcing those relationships. Plus, you never know when you may have one thing and need to get to the other.

After working on a project with an Enormous Core Data database, I found one very useful thing about inverses. When you specify one side of the relationship, core data automatically hooks up the other. Allow me to explain in code.

Let’s say we have a person object with many pets…

<code class=’objc’>Person *john = [[Person alloc] init];
Pet *pet = [[Pet alloc] init];

// Add the one to many relationship from john to pets
[john addPetObject:pet];

// Add the inverse relationship
[pet setPerson:john];</code>

So, I was doing this in all of my code and then forgot to one time. However, to my surprise, everything still worked. Why, because once you set up one of the relationships, Core Data automatically handles the other. So, the above code is redundant and could just as easily have been.

<code class=’objc’>[john addPetObject:pet];</code>

OR

<code class=’objc’>[pet setPerson:john];</code>

and both directions of the relationship would have been established.

Not super exciting, but I found it to be pretty handy and also saved me quite a bit of extra code.

Happy Coding!

RE: Android Developer Income Report

This article was a very interesting with some insight into the Android Market. Basically, this indie Android developer has published 6 free applications and is making more than $1,000.00 per month off of advertisements.

None of my apps has been ever promoted in Top of Android Market

I am providing only free apps (mostly due of Android Market limitations)

Even if I would be able to sell apps I would not use it as main income source… (I believe that you still can make more from ads…)

via Android Developer Income Report.

I think there is an interesting experiment here. I am going to attempt this. Making super simple novelty apps (very low barrier to entry) that are free with ad support. I know this just further convolutes the crap that is the Android Market, but it would be fun to test.

If I actually end up doing this, I will publish some results here.

What not to do in life | TKs weblog

Here is a great article about some advice given to a 22 year old starting his life journey. These points are applicable to anyone, but found them especially applicable to software developers in general.

http://www.tawheedkader.com/2010/11/what-not-to-do-in-life/

Here are a few that I particularly enjoyed

Do not ever work

Picasso used to paint all the time, Henry Moore sculpt the whole day. Others would have thought they were working themselves to death. They actually were reenergizing and reinvigorating themselves. Do what you enjoy doing. Do not ever work.

Do not go into any competition

Quality has no competition. Only mediocrity has competition. If you do what you do at the highest quality you have no competition. Quality creates a moat around yourself.

What this says to me is “Love what you are doing, and don’t make crap!”. These are super wise points that we often overlook. Take for example the iTunes App Store. 300,000 apps where ~ 290,000 of them are total crap. People just writing apps for the sake of making money and not truly enjoying what they are doing.

If you are competing on crap, you are always going to lose.

Tweetpress Plugin Updated

I have just posted an update to my plugin Tweetpress! In case you don’t know, Tweetpress is a plugin I created that allows you to post images to your WordPress blog from mobile Twitter clients instead of a 3rd party service like Twitpic. Here is what’s new in this version.

  • Revert back to WordPress login by default
  • Custom CSS
  • Updated so that the thumbs don’t get a size of 0px when used with SEO images plugin
  • Bug fixes
  • Revert back to WordPress login by default* Custom CSS* Updated so that the thumbs don’t get a size of 0px when used with SEO images plugin* Bug fixes
This update really focused on authentication, I have also updated the about pages for installing the plugin as well as configuring your Twitter client. Here are the important links.
Download Tweetpress from WordPress.org
Tweetpress setup
Twittelator setup
Twitter for iPhone setup

Ludum Dare Competition: Week 2 Update

So another week has gone by and I have made quite a bit of progress, here are the additions since I last posted.

  • Texturing
  • Lighting
  • Skybox
  • Better Terrain generation
  • Environment Fog
  • Basic navigation

So judging by the screenshot, you might really be thinking that I’m working on Minecraft for the iPhone (I used textures that someone created for Minecraft). While this isn’t my intention, it is starting to look like my engine would be perfect for a simple port. Perhaps, I may consider creating something inspired by Minecraft in the future. For now, I will be sticking to my current game idea which I call Cube Hive.

As I continue to update this blog, the game idea will become more and more apparent but basically I want to create a game similar to this on the iPhone in a cube environment.

Anyway, here is a screenshot of where I’m at:

Oh, and BTW doing Fog in OpenGL ES is crazy easy. Here is the code (thanks to Mike Daley of 71 Squared for showing me this)

<code class=’objc’>GLfloat fogColor[] = {1.0f, 1.0f, 1.0f, 1.0f};
    glFogf(GL_FOG_MODE, GL_LINEAR);
    glFogfv(GL_FOG_COLOR, fogColor);
    glFogf(GL_FOG_DENSITY, 0.5f);
    glHint(GL_FOG_HINT, GL_DONT_CARE);
    glFogf(GL_FOG_START, 10);
    glFogf(GL_FOG_END, 20);
    glEnable(GL_FOG);</code>

That’s it! Such a great effect with so little effort.

Anyway, I don’t foresee my game being completed by the end of this month for the Ludum Dare competition. However, I have been working on a killer MUD client for the iPhone that I will most likely submit. I feel that current solutions are clunky, ugly, and unintuitive (sorry if you are a reader and a dev of one of these :/).

I should have some screenshots up soon.

I would love to hear thoughts/opinions of doing a Minecraft inspired game as well?

Calculator Creator Released + Promo Codes

I have recently been developing an iPhone app in my free time called Calculator Creator. This application has been an idea of mine for quite some time and I finally found the time to complete it. Here is the complete description of the app.

The last calculation app you will need to buy!

With Calculator Creator, you are easily able to build your own “Calculators” as long as you know their equations. The process couldn’t be easier.

Simply:

1. Name your calculator (ex Cost Per Square Foot)
2. Add the fields involved (ex Cost, Square Foot)
3. Create the equation (ex Cost/Square Foot)
4. Use the calculator whenever you like

Why purchase a unit conversion application for more, when you could have EVERY unit conversion in one clean application.

Calculator Creator also comes packed with over 20 sample calculators including:

– Unit Conversions
– Mortgage Payments Calculator
– Temperature Conversions
– Tip Calculators
– and more!

If you are reading this and want a free copy of my Calculator Creator, try using one of the promo codes below. Also, please consider leaving me an iTunes review (especially if you are getting the app for free! :))

I would love to hear suggestions for future improvements and features.

Download Calculator Creator on iTunes

PROMO CODES
LRREPTP3E64Y
L6RPN9KYHLFR
9P3YETKR4XTW
H4HF4R4L9K7L
KTRAJYF4M97L
M34ALYRTHJRY
MMFFM7LRJTAP
A3WYL4EKF797
T93FK4479AWX
RHWWJEKNE3AM

PoV’s Challenge: Week 1

After a week of studying my butt off with OpenGL ES, I have finally started work on my game engine for my Pov’s Challenge game.

As you can tell from the screenshot below, I have been playing entirely too much Minecraft and have cube art on the brain.

It’s not much right now, but I do have a basic cube rendering engine that takes in a level file and renders the environment. Here is a screenshot of a very simple level.

It’s not looking super killer at the moment, but I have yet to do fancier lighting or any texture mapping.

Ohh My Game Idea You Ask?

Well, without going into too much detail, it’s pretty much an epic battle of mass proportion set in a 3D cube environment (hint: it’s not iMinecraft ;)).

I will give more details as I go about the month and near the completion of my game.

Also, in case you are interested, here is what the level file looks like for the generated environment.

GG,GG,GG,G,GG,GG,GG
GG,G,G,G,G,G,GG
GG,G,G,G,G,G,GG
GG,G,G,G,G,G,GG
G,G,G,GG,G,G,G
GG,G,G,G,G,G,GG
GG,G,G,G,G,G,GG
GG,G,G,G,G,G,GG
GG,GG,GG,G,GG,GG,GG

The number of G’s that appear represent the height at that location.

The current roadmap is:

  • Texturing & Lighting
  • Collision Detection / Navigation
  • Gameplay & Audio
  • AI
  • Menus / Title / Pause (secret sauce ingredients)

By next week, I should have some sort of level editor and some basic skinning going on.

Hopefully I can finish this sucker by the end of the month. Its’s been an intense journey learning openGL from scratch in 7 days and I know that I still have quite a ways to go. Again, if you are participating in this challenge, link me to your development blog in the comments.

Happy coding!

Game Dev Challenge + OpenGL ES Resource List

The other day, I was reading Ludum Dare and saw a very interesting post. It was a call to action for all game developers to get serious and actually put something out there. Here is a link to the post:

PoV’s Challenge: Make a game, sell 1 copy

The idea is for would-be indie game developers to create a game in the month of October and sell at least one copy. There are no judges, it’s not a competition with anyone other than yourself. According to PoV from Ludum Dare:

Think of this as a race (or a Nanowrimo for games+business). Have something new for sale and in a store by the end of October. And if you can sell a copy (or sign a licensing deal, or earn $1 in ad revenue), you win.

I have been attempting to learn OpenGL since my early days of programming 10 years ago and it has never stuck. I figured this would be a perfect opportunity to really buckle down and learn it. Recently, I have stumbled upon some really great **OpenGL ES resources and tutorials **that have really made things “click” for me. I wanted to share them in this post.

1. OpenGL ES From The Ground Up

URL: http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html

This is a blog created by Apress author Jeff Lamarche. Jeff has been blogging about opengl es for quite some time and probably has one of the best opengl series out there. His tutorials are aimed at the absolute beginner and he takes a very nice approach to teaching OpenGL ES.

The link above will take you to his table of contents of tutorials. Where you can read up on his articles ranging from drawing basic triangles to importing 3D models from Blender.
_

2. Simon Maurice iPhone OpenGL ES

URL: http://www.cocoachina.com/wiki/index.php?title=Category:Simon_Maurice_iPhone_OpenGL_ES

This is an incredible 20 part series that was translated from Chinese to English and posted on the CocoaChina Wiki. These articles take a slightly different approach, while still doing a great job of teaching you OpenGL ES.

The articles are well written and quite comprehensive. It is obvious that the approach isn’t quite as professional as Jeff Lamarche’s blog, however this series goes a lot more in depth and will teach you more complex concepts such as handling touch and moving in 3D.

3. NeHe OpenGL Tutorials

URL : http://nehe.gamedev.net/lesson.asp?index=01

These are oldies but goodies. The NeHe tutorials have been around for years and years. In fact, I attempted to understand them in my early days of coding when I declared every method as static in Java so I didn’t have to instantiate the class to call it (fail). Either way, these tutorials are a staple in the Open GL community.

Although they are not written for ES, they still provide some solid OpenGL concepts. I would strongly suggest reading these after you have read through the other 2. There are some limitation of OpenGL ES (like not supporting GL_QUADS), that will quickly confuse you if you try to write the Nehe tutorials on the iPhone.

One killer thing about the first link I mentioned is, Jeff Lamarche actually ported the first 6 Nehe tutorials to the iPhone and they can be found on the page I linked to.

I will be studying these resources carefully over the coming month. I intend to take the plunge and developer a simple OpenGL ES game in the month of October and sell 1 copy.

So, please join me! If you decide to do this and are journaling your progress, link your blog in the comments. I would love to follow it. I will be doing the same here.

Happy Coding!

This Pretty Much Sums It Up

Source

App Store (Link Share) Affiliate Link Generator

A while back, I wrote a post called ”Money You Might Be Missing Out On” where I discussed the Linkshare API. Well, I took it upon myself to create a simple tool that I have been using in my blog posts to quickly generate affiliate iTunes links for iPhone apps. Here is a screenshot of the app.

The generator is quite simple and perfect for bloggers that are discussing apps. Here is how it works.

  1. Sign up for LinkShare (if you haven’t already done so)
  2. Go to http://brandontreb.com/apps/linkshare/
  3. Enter your LinkShare Token. You get this in the Web Services section if the LinkShare site when you sign up.
  4. Select a merchant. By default, I have already populated it with Apple iTunes. Linkshare supports thousands of affiliate programs, so you can click other if you are using it for something else besides the app store.
  5. Enter the App Store URL of the application that you wish to get an affiliate link for. (ex http://itunes.apple.com/us/app/hundred-pushups/id301174591?mt=8)
  6. Click submit

Now, it will interface with the LinkShare API and produce an affiliate link for your account.

I hope you find this tool as useful as I do.

Great WordPress Plugin To Connect Your WordPress Blog To Your Tumblr

Ok, so maybe this is stupid, reposting your own content in multiple areas. As far as SEO goes, it may not be the best idea. However, I really love Tumblr and I really love WordPress. I can’t seem to part with either yet I don’t quite have the time for both.

I put out a quick tweet earlier today (and this is why I flippin love Twitter), asking if anyone knew of a good way to connect WordPress to Twitter. Here are the popular options.

  1. Use Tumblr’s feed importer (suggested by @abrahamvegh). This option requires you to enter your blog’s RSS feed. Tumblr then scans your RSS feed every so often and pulls the new posts. I didn’t care too much for this approach because it’s not instantaneous. I added my feed and it told me that it would refresh in about an hour. After an hour it still didn’t pull my WordPress posts and had a status of queued.
  2. There are quite a few Tumblr WordPress plugins out there. I have tried a few and have seen no success. Until one of my twitter followers (**@TheSilber) **suggested that I use tumblrize. Tumblrize is a great plugin that worked perfectly right out of the box. It was easy to set up and boasts quite a few options.”Tumblrize posts to Tumblr whenever you hit the “publish” button. It uses Tumblr’s simple API to keep posts in sync; when you edit your WordPress post, it updates your Tumblr post.”

I would highly recommend option 2 if you are planning on syncing your WordPress blog with your Tumblr.

Download Tumblr.ize Here

Would love to hear about some other interesting solutions. Feel free to post them in the comments.

SEO: Works Every Time

So I received an internal email at work the other day about how we could SEO our company website (http://elctech.com). Here was my suggestion:

“Just put up a few <h1> tags that state (in this order) Rails, Coding, Consulting, Porn, Free Porn, Porn on Rails, Viagra, iPhone, development, hot chicks, elc.

Guaranteed hits!”

Genius right? So after a while, a fellow employee (@maxmurphy) suggested we implement this rails solution:

<code class=’ruby’>["Rails", "Coding", "Consulting", "Porn", "Free Porn", "Porn on Rails", "Viagra",
"iPhone", "development", "hot chicks", "elc"].each do |seo|
  "#{seo} \n ELC ROCKS #{seo}"
end</code>

Perfect!

Feel free to steal this and you too can be an SEO Guru!

6 Traits Of A Successful Developer

I really enjoyed this article on traits of developers.

http://www.turnleafdesign.com/6-traits-of-successful-developers

In my experience, developers tend to become arrogant and totally ignore #1 (see Windows Devs). I feel that this is the most important trait of all.

“For a developer to be successful over any period of time a continued commitment to learning is absolutely vital. The field is too large, too quickly changing, and too in depth for any developer to ever “know it all.” Luckily there are a lot of resources a developer can use to learn; books, co-workers, classes, blogs, among many others.”

Great HTML5 Infographic

This info graphic just about sums it up in terms of what is HTML, and why we should care. It includes browser readyness, various API support, comparison of competition, and more. Check it out.

Technology + Fitness = <3 :: 3 Apps That Will Keep Even The Laziest Geek In Shape

If you are reading this post you are most likely a geek. It’s true, otherwise if you were a reader of my blog and not a geek, you would be very confused ;).

Well, being a fellow geek, I am prone to the same sort of problems as you when it comes to fitness. As geeks we sit in our chairs and more often than not end up looking like this. (sad face)

Ok ok, that photo is a little cliché, but you get my point. This prolonged sitting along with a lazy (Mountain Dew + Cheetos ) diet leads to this stereotypic geek look.

The Solution

Dun duh dun duh (those were trumpet sounds in case you didn’t know). Well, we all love technology (duh), so why not combine it with some basic fitness and fight the stereotype. With sweet gadgets (like the iPhone :)), we now have some incredible tools that almost make a game out of exercise.

Here are 3 iPhone apps that I use on a daily basis to keep me in peak, geek, 1337 shape.

#1 100 Pushups

I stumbled upon this gem of an app when I started seeing my buddy @oodelali ‘s Twitter feed displaying the following.

160 Pushups! Gangster right? Intrigued, I asked him about the app. After a brief synopsis, I was sold. Here is the rundown of this app (per its app store description).

“If you’re serious about increasing your strength, follow this six week training program and you’ll soon be on your way to completing 100 consecutive push ups!”

Basically, this app utilizes interval training where you exercise 3 times per week for about 10 minutes. After 6 weeks of this, the app claims you will be able to do 100 consecutive pushups! Here is a screenshot so you can see what I’m talking about.

So far, I’m on week 4 and am doing a total of 94 pushups (not consecutive yet).

**Don’t have an iPhone (sad face), you can still benefit from this app by using their web interface at **http://hundredpushups.com/.

The developer of this app has a whole suit of these including 200 Sit-ups, 200 Squats, and Twenty Chin Ups.

#2 Run Keeper Pro

Run Keeper Pro is a stellar app that has both paid and free versions. It uses the GPS to map our your run and gives you feedback on elevation, pace, distance, and location. I use this app every single day when I go for runs.

One killer feature of this app is its ability to sync with the web at RunKeeper.com. Here you are able to track more statistics about your runs, create paths, and get more social.

The interface is both beautiful and intuitive. (Aesthetics are super important to me. You could have the most functional app in the world and I won’t use it if it looks like feces).

When I first started running, I could barely make it to the end of my street, and with this app, I am now running over 10 miles per week!

#3 iFitness

So, this app is for the geek that might actually go to they gym (you mean like…leave…the house). Or if you are really a hobbit, have a home gym. iFiness allows you to track all aspects of a workout. It will track what exercises you do, on what day, with how many reps for how long.

With these killer features, it’s easy to create a fully customized workout and track it the way you want.

“But Brandon, I have never been to the gym and don’t know how to use the weights/machines because I’m level 75 in WOW.” Well, iFitiness has got you covered! For every workout they have in the system, they provide full graphics or videos on how to perform each one. So if you are unsure about how to do anything, just take a quick peak at your phone, jump on the machine, get jacked, and the ladies (or dudes if you are a lady reading this) will be flocking from all over.

Another great feature of this app is that it has built in workout plans to suite your lifestyle. So weather or not you want to build muscle or you just want to lose that gut you have been working on, they have a plan for you. Whoa, I am starting to sound like a P90X commercial, time to pump the breaks.

Take Away

To wrap up, I feel that staying healthy and fit is very important. You have to make it a part of your lifestyle and these few tools are a great way to get a jump on it. Feel free to post comments, questions, or grammar corrections (expected bc we are all the grammar police) in the comments.

WordPress For iPhone/iPad NSXMLParserErrorDomain Error 64 Resolved

If you have a WordPress blog and an iPhone/iPad, then you most likely have the WordPress for iOS app. If you don’t, you should.

Over the past couple of days, I have been receiving the following error when trying to add my blog to the iPhone app.

After scouring the internet, I found that this could be the result of a few issues.

  • Special characters in a post body that are not supported by NSXMLParser
  • Special characters in a comment
  • Invalid post or comment RSS
  • An error in a theme/plugin file

For me, this turned out to be an issue with the comments RSS feed. I loaded it up in the browser and long behold, even the browser threw an error. But what could be causing this? Turns out, I had left a space in a plugin that I created. This caused a space to be output at the beginning of the comments XML, causing it to error. Notice the space between ?> and <?php below. (Face Palm)

After removing the space from this plugin, I loaded up WordPress for iPhone and it added my blog without a problem.

So, the take away from this is don’t output spaces when you create a plugin.

I hope this post has proven useful for you, I can’t imagine that I’m the only person with this issue 😉

Feedburner Anywhere Plugin Updated

I have updated my WordPress plugin Feedburner Anywhere. In case you are unfamiliar with it, it’s a plugin that allows you to output your Feedburner subscriber count anywhere on your blog.

**The Problem: **Since Google took over Feedburner, I feel that it has been quite unreliable. A few times a week, Feedburner would return 0 for your subscriber count. This was an issue with the plugin. If the return value was 0 when the plugin pulled and cached the feedburner data, you would look like you had no subscribers.

The Fix: I am now caching the values returned from Feedburner. If for any reason Feedburner returns a 0 subscriber count, the last known value (greater than 0) is used instead.

Download the updated plugin here

If you have any other suggestions for the plugin, please let me know.

Simple Office Fitness: Replace Your Office Chair With An Exercise Ball

When I was in Portland this past month, I saw that many people in my work’s office were sitting on large exercise balls instead of office chairs. Curious, I researched the benefits and decided to purchase one for my home office. The benefits include:

  • Improved posture – sitting on the ball forces you to sit up straight of you won’t be very comfortable
  • Constant movement – Sitting for long periods of time can be bad for you, even when you exercise. Check out this recent study that was discussed on the New York Times. When you use an exercise ball for a chair, you are constantly repositioning yourself and are combatting this issue.
  • Getting Jacked! – having a ball for a chair has encouraged me to exercise during my down time. Code is compiling…bang out some crunches. I will now do ~ 300 crunches per day while waiting for various tasks to complete.
  • They are cheap – Most exercise balls range from $15-$25. Check out Amazon for some deals. I recently purchased one at Target on sale for $9.
  • It’s fun – Need a break? Just bounce a bit on the ball 😉

While I’m not saying to completely replace your office chair with an exercise ball (you will end up switching back an fourth a bit), it is a great way to stay in shape and enforce good posture while at work.

Test Version of TweetPress 3.0

So WordPress 3.0 has broken Tweetpress for many people. If you are daring, willing to help, and experiencing issues with Tweetpress, please download the 3.0 test build of Tweetpress and install it on your WordPress blog.

Here are your next steps after installation:

  1. Make sure you add your Twitter username and Password to the Tweetpress settings in your wp-admin and save it
  2. Attempt to post a photo to Twitter using Twitter for iPhone
  3. If it works, you win, let me know, if not do this:
    1. go back to the tweetpress admin in wp-admin
    2. click the log link at the very bottom
    3. copy the text and email it to brandontreb [at] gmail [dot] com with the subject “Tweetpress Log”

This will really help me troubleshoot the issues that everyone has been having.

Thanks!

Download Tweetpress Test Build 3.0

Feedburner Anywhere Plugin Released

Image representing FeedBurner as depicted in C…

Image via CrunchBase

I have just released another WordPress plugin called Feedburner Anywhere.

What it does is allow you to display your RSS subscriber count anywhere on your blog.

You have the choice of using the built-in widget, embedding it in your posts/pages, or a combination of both.

Check out my sidebar for an example of usage.

Download Feedburner Anywhere at WordPress.org

Reblog this post [with Zemanta]

HECK YES C Macro, For When Something Is REALLY True

Quite possibly the most useful macro you will ever use.

#define HECK_YES true && true
 
// Usage
if(self.sleepy)
{
   self.needsCoffee = HECK_YES;
}

Now if only I could replace semi colons with exclamation points…