Another year gone by…


Wow, it is so hard to believe that I have been living the life of a freelance Rails developer for the entire year of 2012.  What a year it has been.

I have learned so much this year and expect to learn more next year.  I know that it is early for new years resolutions but I plan on being more active in the Ruby community next year.  I will finally get off my ass and start creating screencasts and doing local presentations for what I call “Rails, now what?”

I know that all of us in the Ruby community owe so much to others that have come before us.  Many are those that are unnamed and others we all know of.  No matter how much or how little, we are all part of the community and are all responsible for growing this community.

Let’s all try to teach other more next year.  Let’s all try to stay away from the Rails community drama that makes all look like arrogant assholes.  Let’s all remember what it was like when we were just starting out and how much we appreciated help from others.  Next year let’s all of us take the time to teach one other person about Ruby.  There are people that are interested in becoming interns.  Find them, teach them and set them free.  The best RoR programmer you will ever hire is one that you yourself have trained.  Let’s all of us commit to giving at least one presentation this upcoming year.

Remember people, that we are what we are because somebody helped us out once upon a time.

Here is to a great 2013 and lets all make Ruby on Rails the best that we can!!

Testing with Rails Select2


Lately we have been incorporating select2-rails into our applications.  I cannot say enough how much I love this tool and its ease of use.

That being said, we had had issues with testing and select2-rails.  So Steve Tong of Rebel-Outpost spent some time and found a small script to use for testing it.

The only issue with this is that you can only have one option in the select2.

If anybody finds a better way, please let us know.

Ubuntu 12.10 Server Setup for Ruby on Rails, Passenger, Nginx


So we all know what a pain in the ass it is to setup a new server for Ruby on Rails. This is why I love to use Heroku for hosting. There are times that this is not an option so we have to use a hosted linux server. For this walk thru I used Rackspace with Ubuntu 12.04 for hosting. This is about as fully detailed as possible.

Server Setup

  • Create new server on Rackspace
  • Login to new server
    • ssh root@IPaddress (you can also use the domain name if you have the DNS setup already)
    • accept the RSA key
    • use the password provided at server setup
    • change the password that was provided at setup:
      • $ passwd
  • Create a new user for deployment
    • $ sudo adduser “username”
      • accept the defaults
    • add new user to staff and sudo groups:
      • $ usermod -a -G staff “username”
      • $ usermod -a -G sudo “username”
    • switch user
      • $ su “username”
  • Update and Install dependencies:

  • To make our live easier, lets go ahead and add our ssh keys to the new server so we do not have to sign in every time (this is done from your machine and not on the server):

$ cat ~/.ssh/id_rsa.pub | ssh root@IPaddress “cat >> ~/.ssh/authorized_keys”

Install Ruby

Install your Ruby (obviously you use the version that you want. At this point many people use a Ruby version management like RVM or RBENV. As these servers are normally setup for just on application we will use the system version of Ruby):

Passenger and Nginx

First let’s install Passenger and Nqinx:

Setup script to control Nginx:

You should be able to control Nginx. To start and stop server:

  • Go to your IPaddress (or domain name) and you should see “Welcome to nginx”
  • After installing nginx, you should see the following message in the terminal:

Screen Shot 2012-11-22 at 5.42.34 PM

  • Setup the nginx.conf for our server
    • edit the /opt/nginx/conf/nginx.conf
    • add the IPaddress to the server name (You may use the domain name if you have one)
    • add the path to your apps public directory to the root
    • add the user to the nginx.conf
      • user “username” staff;
    • if necessary, set the rails environment using rails.env

 Screen Shot 2012-11-23 at 1.16.58 PM

Database Setup

At this point there are a lot of different ways to go. The database needs to be setup. There are multiple options for databases such as MySQL, PostgreSQL, and Mongodb.

MySQL

Deploying Rails

There are also several options for deploying your Rails application. The option that I am going to use is a nice little gem called git-deploy.

After following the directions for git-deploy:

  • ssh into the server
  • cd into you application
  • check your Rails environment$ echo $RAILS_ENV
    • if it needs to be set:
      • add “export RAILS_ENV=staging” to the the ~/.bashrc
      • $ source ~/.bashrc
  • run bundle
  • rake db:create
  • rake db:schema:load (if needed)
  • rake db:migrate
  • touch tmp/restart.txt

Rails CRM


An ongoing pet project of mine has been Rails CRM which is a CRM (Customer Relations Management) built on Rails and using Mongodb for the database.  This was also a practice project for my last intern Ricky.  This all came about when we were trying to find an open-sourced CRM for RebelHold to use.  There are a few out there but none using our preferred and probably the best database, Mongodb.  Many also had a lot of shall I say baggage.  I was looking for a more or less basic CRM to customize and finally came to the conclusion that I would need to make a new one.

Well recently I spent quite a bit of time cleaning up the Rspec tests and the Twitter Bootstrap layout.  It is by no means ready for primetime but we are really close.  Most of the basic functionality is there but I am planning on adding some more bells and whistles.  After that, I am going to leave it alone and use a clone of it to further customize for our use.

You can find more information on the Rails CRM homepage or can find the project on Github.  Please feel free to email me ideas/suggestions/bitches and/or complaints.  I will update when the project is fully completed.

Update: You can now go to railscrm.com or to check out the demo, go to demo.railscrm.com.

What I have learned as a freelance developer


Well, I am almost at one year since I quit corporate America and went freelance.  I am not really sure what the definition of a ‘freelance’ developer is and I don’t care what wikipedia says it is.  All I know is that I do NOT work for a company and I consider that freelancing.

So what have I learned in the almost year of not working for the ‘man’?  I would have to say a lot.  Let’s break it down into pros and cons with the cons up first.

Cons

  • No health insurance
    • Now this might not matter to all of the younger generation of developers, but at my age this is something that I dreadfully miss.  There are options out there for individual health insurance but they are overly expensive and that is a shame.
  • What am I doing next week?
    • It can be said that there is security in working for a company, but I have seen that to be a fallacy in many situations.  I left my ‘corporate’ job when they started to cut out benefits.  I figured that was the writing on the wall that things were going to be tight for some time to come.  To me it seemed that IF they were going to pull employee benefits, then the chances of a raise anytime in the near future were pretty slim.
    • The best way to counter this ‘fear’ is to secure large projects whenever possible.  This may mean making less money but for a guaranteed amount of time which for me was the case and that in itself added a feeling of security.  There is no guarantee of anything in this world but try to give yourself as much of a safety net as possible.
  •  No taxes
    • This might sound like a great thing but I am shitting my pants in fear on next April.  Set the money aside for taxes or you will regret it.  This sounds like a no brainer but I know this and I have not done it.  Epic Fail!

Pros

  • Being your own boss
    • Now this could go in the cons category for a lot of you.  It takes something to be your own boss.  You have to be a bigger asshole than any boss that you have ever worked for.  It is so easy to get lazy when there is nobody looking over your shoulder.  This really is not a good situation for everybody but if you are dedicated, then this really is a pro.
    • Work hard and play hard but don’t burn yourself out.  There are many development companies out there that adhere to a 4 day work week with Fridays being set aside for open-source or fun projects.  Do not work yourself to death which is the extreme opposite of being lazy and occurs more often than not.
  • Unlimited Income
    • Now there really is not anything as unlimited income but as a freelancer you have the opportunity to make as much (and as little) money as physically possible and by that I mean that there are only so many hours in the week and one does need some sleep.
  • Your own time
    • You control your time.  Obviously you have deadlines for your client(s) but how you spend your time is up to you.  Use it well and do not waste it.
    • Work on open-sourced projects.  I have heard that this is a great way to get your name out there.  Make the time to learn something new and to work on your own project.  In my case I found that there was not any Ruby on Rails CRM out there that was based on MongoDB so I decided to make my own Rails-Mongo-CRM in the hopes that people will see not only my work but that I am giving back to the community.
  • Do your own thing
    • I fell that the bottom line is that you can do your own thing.  Do what you want to do and what you enjoy doing.  The moment that you no longer ‘enjoy’ if, go back to corporate America

Rebel Outpost


Since we fired up the Rebel Outpost member of RebelHold, we have added a website for it.  In putting together the website, we had to think about what we want and who we are to put that up on our site.  It was interesting for us to sit back and discuss this.  I fell that we all have the same general idea in mind but there are parts where these ideas are different.

When we talked about what we want, it was quite apparent that the guys are mostly interested in mobile development.  I myself am totally fine with RoR web applications, but the others want to really get into mobile development.  A couple of the guys have already been involved in mobile development and spend the majority of their spare time working on mobile apps.  Even though we got our start as a RoR shop, I see the transition to adding mobile apps to our list of specialties.  We will always strive to learn new languages and to stay current with everything that we do.

The who we are part was pretty simple to define; a group of developers working as a collective as is the RebelHold way. We come from different backgrounds and make up a assortment of skills.  We work together on various projects as well as our own personal projects.  Most of what we do we leave as open source so that others may use it as well.  We feel that having a broad variety of talent gives us the edge in that we can provide many services to our clients.  We want to build the very best applications for you. 

Rebel Against the Norm

Life as a Rails developer


So Holy Shit, I am coming up on my 7 month anniversary as a full time Ruby on Rails developer.  I guess the old adage that time flies when you are having fun.  So true indeed.

I figured that it has been a while since I posted and that I need to get with it again.  On a daily basis, I am still learning so many things.  I really need to share these findings and I will try to do more posting in the near future.

So being a partner with Rebelhold, LLC absolutely kicks ass.  We are still at 3 partners but we now have two paid apprentices and working on adding a third very soon.  It is so nice to be able to return the favor that Rebelhold showed me by teaching me RoR and how to be a good developer.  I am still lead developer on a big project and I have one paid intern that I am teaching now.  I have also brought on another intern that as of yet has not made it to paid status but I feel that is not so far off in the future.  I was asked a while back what I have done for the Ruby community, and this is what I have done and do.  To top that off, we do not charge to teach and on the contrary, we pay our interns to learn once they have established a basic knowledge of RoR.  It is a goal for us at Rebelhold to train apprentices to work for us.  If they choose not to work for us after the training, then so be it but we still intend to continue teaching members of our community, regardless of who they do to work for.

We as Rebelhold has risen to the go to Rails shop in Arizona.  Many of the other Rails shops do not have the resources available that we do.  We have dev’s waiting for us to get more work so that they may come on board as well.  Rebelhold will continue to be a go to Rails shop and we plan on expanding to other languages and platforms as well.

Ok , so enough preaching for now.  I wanted to share some things that I learned over the last 7 months and hopefully somebody finds some of this as useful.  So here it goes……..

  • Keep learning
    • I don’t care how many hours a day or days a week that you are working, find the time to learn something new EVERY day.  There are so many tutorials out there that there are too many to list.  A good way to end the day is to watch a tutorial or try something new.
  • Write Code
    • A lot of beginners get stuck in the keep learning part.  Watching tutorials and coding along is great.  Studying all there is to know about Ruby and Rails is great.  However, you will learn the MOST by trial and error.  Write code, write code and write code.  Create as many blogs, fake store fronts or whatever you want to but keep writing code.
  • Mentors
    • Aside from the fact that Rubyists are really arrogant, they love to talk about Ruby.  I have NEVER asked a question to a Ruby or Rails person that was not answered.  Find a local user group and go.  The last intern that I brought on was a guy brand new to RoR but I saw him at every Ruby::AZ monthly meeting.  Sometimes the desire to learn outweighs all.

That to me are the biggest things to get going.  Oh yes, there are a million other things that can help you get rolling but these are in my opinion the biggest.

Oh yeah, why would you want to be a RoR developer?  Supply and Demand is why.  The demand for RoR dev’s is insane.  If you are a RoR dev and on LinkedIn, you will get job offers daily.  Write a blog about RoR and you will get even more job offers.  The job market for RoR devs is totally all demand.

One last thing….I hated my old job and it was exactly that, a job.  If web development is your thing and you like Ruby on Rails, then I say do it.  Keep learning and get Earning!

BR

Why RebelHold kicks Ass!


Well, I have been a bit busy lately and it seems like I have a thousand things that I want to work on.  If I can only find the energy and the time to do so…..

So, this is about why Rebelhold totally kicks ass!  A couple of weeks ago I was made partner!!  How is that for advancement opportunity?  Do I miss my old corporate America job?  Fuck NO!

So here I am now a co-owner in a company owned and operated by its employees.  I know that I have ranted before about the awesome opportunity that RebelHold has given me.  I had the desire to become a Rails programmer but who hires anybody these days with no college or experience?  McDonalds, that’s who.

RebelHold will soon be a major name in the Rails web development community.  I want RebelHold to be the premium place for Ruby and Rails developers.  We are a collective of developers that encourage people to learn Ruby and Rails and we also believe it is our job to assist in the learning process.  We are building a community of programmers and designers and continuously improving ourselves with in house training and classes.  We have recently made the decision that Fridays are to be set aside for just that purpose.  Who can go to work with us?  Pretty much anybody that has a strong desire to be the best.  You will have to prove yourself to us that you have the desire and willpower to become one of us. We freely support our apprenticeship program and encourage all of those interested.  We are currently expanding our knowledge base to include IOS development as well.  We have members in several states now and are always interested in new talent.  In @m3talsmith’s own words:

“We believe that through working under such equal conditions, both to us and our clients, and through such revolutionary processes as being honest with each others skill sets, teaching each other, growing in a community that seeks the most quality out of everything that we do, that we will create great software.

Some of the tools we use to hone this process include frameworks, such as Ruby on Rails, methodologies, like Agile Development and Scrum, elastic data stores, MongoDB being our favorite, and cloud servers like Heroku. Other steps include lots of travel, a reasonable week of around 30 hours per week, and lots of pair programming; as well as constant experimentation and open source contributions.

We are also looking for ways to build passive income in order to put us on sound financial footing outside of client work. Some of the passive income ideas include equity in clients, software services, and applications brought to markets such as mobile marketplaces.”

That is why RebelHold kicks ass and why I do not miss the corporate world!

Are you prepared to Rebel?

We ARE RebelHold.

Python or Ruby….


I see that a lot of my hits come from the question of Python vs. Ruby.  I think that the two are absolutely two different species.

If you are going to do anything in GIS or ArcView then Python is the way to go.  ESRi has embedded Python into its applications and I assume that Python will be there for a long time to come.

Primarily the two languages are very similar.  I think that the choice must be decided on what to use them for.  I feel that there are a lot of aspects of Python that are better than Ruby and vice-versa.

The line between the two becomes more distinct when you look at web applications and the programming community.  Here is where I start to piss people off……..

I (and again it is my blog and my opinion) feel that Ruby on Rails is EASIER to learn and use than Django.  For those that do not know, Django is written in Python such as Rails is written in Ruby.  You cannot compare Python and Django any more than you can compare monkeys and elephants.  They are two absolute different things.  You can however compare Rails and Django.

Now this is what I have discovered as far as the community goes between Django and Rails.  I have already posted that I (again my blog) feel that Python/Django users are a complete different species than Ruby/Rails users.  To me the Python/Django users are those that prefer to work alone and dislike the mob mentality as opposed to the Ruby/Rails users that are a very close knit family.  In my attempts to learn both Django and Rails, I have found a lot more support and people willing to help learn which leads me to yet another tirade of mine….

As there are so many places to learn and get help learning different languages (I have often blogged that if you have any questions, feel free to contact me) I am totally against ANYBODY charging to teach either of these languages.  Sure everybody deserves to make money but how many of those out there learned from somebody else and are now charging to teach others.  Maybe my attitude is skewed as programming in general is a hobby to me although I do get paid for it sometimes.

Take for an example one such person out there that spends who knows how much time creating Railscasts (http://railscasts.com/) also known on Twitter as @rbates the world famous Ryan Bates.  Now I am sure that somewhere he is making money to do what he does but I do not care if it is FREE for me!  Take for example my routing articles or posts; many people/companies charge for the information that I give away for free just like Ryan Bates.

Now for those of you that I have pissed off……..If you make money charging people to take your programming classes  I do not fault you.  I myself will NEVER pay to learn programming especially Ruby on Rails as there are way too many tutorials out there and too many people willing to help.

Keep open source open source and help others as others have helped you!

Next Steps….


All I can say is that keeping up a blog is a lot more work than I ever thought it would be. With that being said, email me if you would like to add an article to my blog as a guest author.

I have gotten quite a few requests for video tutorials and I am planning on creating some for geoprocessing.  I am thinking very short and sweet “how to’s” for the various basic geoprocessing functions.  I have seen a little interest in Phoenix for Python geoprocessing classes for which I would love to do if there is enough interest.  I am hoping that fellow members of the DesertPy.org group will also be interested in sharing their knowledge/experiences for some more basic Python training.

As usual, if you have any questions, comments, or bitches, feel free to contact me.

BR