Blog

  • How To Test Image Uploads With MiniTest On Padrino

    This week I got to pair program with Oren Golan whose last high profile job was at Border Stylo. While there, he wrote a series of excellent blog posts that I highly recommend reading. The one that caught my eye was his post on MiniTest, that’s a lighter version of RSpec.

    We created a Padrino app that uses the Sequel gem as an ORM for SQLite.

    We tested a raw file upload and the uploading capabilities of Carrierwave.

    The working test is on http://github.com/barce/test, and to run it just clone the repo and type the following:

    cd test
    bundle install
    padrino sq:migrate:up

    Here’s the test:

    # put this into the test/test.rb file
    require 'rubygems'
    gem 'minitest'
    require 'minitest/autorun'
    require 'rack/test'
    require '../config/boot.rb'
    
    class TestManualBadgeType < MiniTest::Unit::TestCase
      include Rack::Test::Methods
    
      FILE2UPLOAD  = "/Users/jimbarcelona/pink-pony.jpg"
      UPLOADEDFILE = "/Users/jimbarcelona/repos/oren/forks/test/test/pink-pony.jpg"
    
      def app() Test end
    
      def setup
        if File.exist?(UPLOADEDFILE)
          File.delete(UPLOADEDFILE)
        end
      end
    
      def test_opload
        post '/', 'file' => Rack::Test::UploadedFile.new(FILE2UPLOAD, 'image/jpeg')
    
        assert_equal last_response.status, 201
      end
    
      def test_carrierwave_201
        post '/carrierwave', 'file' => Rack::Test::UploadedFile.new(FILE2UPLOAD, 'image/jpeg')
    
        assert_equal last_response.status, 201
      end
    
      def test_carrierwave_file_exist
        post '/carrierwave', 'file' => Rack::Test::UploadedFile.new(FILE2UPLOAD, 'image/jpeg')
        assert_equal last_response.status, 201
      end
    end
    
    

    Now you’re ready to run the test upload:

    cd test
    ruby test.rb
  • In LA Coders Are Scared To Take Risks

    In Los Angeles, it’s pretty hard to find good coders for a startup in this market. I’d say even harder than in Silicon Valley. Social media experts are easy to come by here, though. Why? Most coders in LA are scared.

    To start things off, I just want to say that I’ve tried and swung for the fences at an LA startup at a very reduced salary. I am still smarting psychologically and fortunately no longer financially from it, but as soon as I’m strong enough, like tomorrow, I will start swinging for the fences again.

    I’ll talk about perks that companies in LA offer, the difference between the labor force in LA and Silicon Valley, and what companies can do to hire new recruits for a startup. No matter what the size of your business, even if it’s only a part-time gig, an arizona tax ein is an important tool to have.

    Perks

    Most startups provide the following perks:
    1. A new laptop
    2. A new phone
    3. 1 to 2 telecommute days per week because the LA traffic is awful.

    More established companies like Google & Microsoft can provide on top:
    4. a stipend for further education ($2000 – $10000 / year)
    5. daycare
    6. “free” lunch — we know that this means shorter lunches and higher productivity
    7. gym
    8. trips to conferences like SxSW or the Web 2.0 Expo or Macworld

    With the new Google office opening in Venice there will provide further strain on a small pool of coders.

    The Talent Pool: LA vs. Silicon Valley

    The pool is interesting. (source: http://www.calmis.ca.gov/htmlfile/msa/sf.htm & http://www.calmis.ca.gov/htmlfile/county/losangel.htm )

    Silicon Valley Information Technology Workers (excludes hardware, e.g. Apple, Intel, financial software which would total 387,000): 49,900

    Los Angeles Information Technology Workers (excludes hardware, financial software which would total 758,000): 106,100

    Despite having a smaller pool of talent, Silicon Valley tech workers’ companies are able to produce 1% of the GDP of the United States or $174 billion annually.

    Compare this with Los Angeles which despite having sheer numbers will only produce $10 billion this year.

    Silicon Valley produces $3.8 million per worker and Los Angeles roughly $90,000 — just enough to keep the lights on.

    How do we account for this discrepancy?

    I did an informal survey of different Los Angeles based Information technology companies. One common theme: although espousing a culture of innovation, and although some are very profitable, most are simply not cutting edge, and some are very behind the times. This means that Los Angeles is not taking advantage of innovations in automation.

    Let’s take MySpace which many used to be a flagship of Internet technology in Los Angeles. In most Silicon Valley Startups, coders know SQL, a major scripting language as well as HTML and CSS. However MySpace had positions solely for just HTML/CSS, a trend that harkened back to the 90s when web pages were manually created.

    Another Los Angeles great, eHarmony.com, uses 40 to 50 engineers for its matchmaking algorithm and servers, whereas OKCupid.com uses only 10.

    Also, the *big* main factor is that if you look at the graduating class of 2011 from Stanford for CS and compare it with UCLA, UCLA has only 60 CS majors out of 800 going to startups. Stanford has half!

    How do you recruit? How do you get unscared?

    The pool is so limited but deceptively so. In LA the coders are there, more than there are in Silicon Valley. The options seem to be:

    1. Train people willing to take the risk on a startup.
    2. Entice folks in already cushy Fortune 1000 jobs or similar to jump ship.

    I’ve done option number 1 a few times already and it can take 6 months to a year assuming they’ve got the chops. Option 2 is still a bit of a mystery to me. If you have any thoughts for making LA coders take more risk, please feel free to comment below.

  • Traffic Has Been Phenomenal! Thank you!

    Traffic has been phenomenal! Thank you!

    Awesome Traffic

    Stick around for details, because I would love to thank my readers with a Tweetup / Drinkup.

    Got any tips for a breaking tech story? Email me or reply to me on twitter: @barce!

    PS I’ve listened to the suggestions on Hacker News and have removed the pictures of the cuties to make things less confusing. In future pieces, the author’s pic will clearly accompany the post.

  • What’s It Like To Be Fired?

    I got fired many years ago while working as a web developer. I won’t go into who or where. This is just a description of what it’s like to be fired and how to cope afterwards.

    I am hoping this will help some folks out there for when this tech bubble bursts and more firings occur.

    When I got fired many years ago in the 90s, it was a surprise to me. My boss the previous week had told me what a great coder I was. The CFO and CTO met with me in a room. They told me the cause for my termination and then said, “Because of that, we have to terminate your employment.”

    They gave me 2 papers to sign. One was the grounds under which I would receive severance (i.e. do not mention that we fired you for 7 years), and the other mentioned that I had to exercise my stock options in 1 month or forfeit them. I signed both papers with tears almost ready to start running down my face while the CTO said, “I had nothing to do with this.”

    If you get fired, 3 awful things happen if you are a coder:

    1. In the startup, tech community, if you get fired, you become a persona non grata. That means all the social circles I had booted me out. I literally had to start from zero.

    2. You cannot use the employer who fired you as a reference.

    3. I know there’s no techie blacklist but the only 2 jobs I could find were as a spam engineer or in a totally different industry. I chose the latter.

    I don’t regret getting fired. I became a wandering gypsy coder for a few years and saw different parts of the world. It takes awhile until you get enough experience so that gap of where you got fired is in the deep past. Also getting fired is something that shouldn’t come as a surprise. I’ve learned how to spot when a firing will happen. Here are some major signs:

    1. You are scapegoated. Or have insurmountable personal difficulties that just can’t be ameliorated. If this is you, it’s best to just get out of Dodge. Develop more social skills.

    2. You failed to deliver on a big project. There are two solutions: immediately work on a project that is in trouble. This is rough but if you make it succeed, then folks will forget the failure. The other solution is just leave.

    3. Your skills don’t really match your job. This is the main reason for most firings, but is the easiest to fix. Get more training!

  • How I Use The Node.js Circle On Google Plus

    I really got into Google+ when I got an email from Guy Halford-Thompson, the author of the Cache Me blog that was sent to the Node.js mailing list.

    Im sure many of you already have your Google Plus accounts. I for one
    have finally got mine and am super excited.

    Got my NodeJS circle set up but no one to add to it. Please add links
    to your profile below.

    Mine is https://plus.google.com/115891284931777059273/posts

    About 24 hours later, more than 100 of the 5126 member list has jumped into the Node.js circle.

    When you are on a mailing list, you don’t see faces, and there’s a lot of context missing. Google plus brings the context to the mailing list.

    Here’s an example:

    Now I know that Andrey speaks Russian. He might be in Russia so if he ever sends something on the list, replying to him around business hours at around Moscow time might be the way to go.

    Here’s another example:

    I just learned about the Google Plus Extension. Although this is information outside of the Node.js list, I’ve got a richer context. I also gave the link to the extension a +1.

    Have you turned your mailing list onto Google Plus? Try it, because it might give you the warm fuzzies about folks on your list.

    PS: This is a blatant plug for an awesome place I’ve been working, RadicalFusion. If you need an app built using BDD/TDD contact us!

  • Coders Who Don’t Job Interview: Zed Shaw

    I wrote a piece about the current state of job recruiting from a coder looking for work. I wondered:

    What would it be like if you didn’t have to do a job interview?

    (The non-tl;dr summary is below.)

    By “job interview,” I just mean the normal process where I job candidate replies to an ad, contacts an employer directly, or works with a recruiter, and gets a job through that process. High-profile experts are courted, or work out a mutually beneficial deal where it doesn’t feel like an interview.

    I asked around for folks that didn’t have to interview. One name that consistently came to the top was Zed Shaw.

    Zed is the creator of the Mongrel Web Server, and a really great framework that is powered by Mongrel, Tir. Personally, I first heard of him from a video Leah Culver linked to on a talk that Zed gave, “The ACL is dead.” A careful viewing of that talk is always rewarded, especially if you are a coder freelancing for a corporation.

    Here’s my interview with him (conducted over email). Thanks Zed!

    Barce: What’s your own process for choosing the projects you want to work on?

    Zed: Within my profession I try to just work on whatever is needed to get the
    project or job done. Sometimes that ends up being a lot of crap work so
    other people can do more important stuff. Professionally I don’t mind
    this kind of work as it’s low investment and removes the pressure off
    other folks who would rather do interesting things. I think I also tend
    to pick off the lower level work because most of my original ideas are
    usually too weird for a professional setting.

    Personally, I tend to work on projects that match ideas I might have,
    and usually they have a secondary motive that’s outside of programming.
    Many times these ideas come from combining a couple of concepts, or
    they’re based on a problem I’ve noticed, or they are just a kind of
    funny joke or cool hack I thought up.

    I think the most important thing is I don’t try to plan my inspiration
    in my personal projects, but instead go with it when it comes. I don’t
    have a “process”, and in fact I think “process” kills creativity.
    Proess definitely helps make creative ideas a reality, but it doesn’t
    create the initial concepts very well.

    Professionally though, inspiration is for amateurs and I just do my
    work.

    Barce: What advice can you give someone who feels trapped by their job or surrounded by recruiters?

    Zed: Well, if you’re trapped by your job then I’d say start working on
    getting a new one. Nobody is every really *trapped*, but maybe you
    can’t just quit right away. Instead, work on projects at home,
    constantly look for new work, and move to where the work is. Even if
    it’s temporary, moving to say San Francisco during the boom times could
    be a major boost to your career.

    I’d also say that going back to school is a good way to update your life
    and change your profession. I’m a firm believer in getting government
    student loans and using them to go to school. They’re cheap, low
    interest, and the US government is usually very nice about letting you
    pay them back. I’m not so sure about other places around the world
    though.

    Barcee: What’s the most disruptive technology you know about right now?

    Zed: If I were to be honest, I’d have to say Facebook, even though I
    absolutely hate it. It’s probably the one technology in recent history,
    maybe after HTTP and the Browser, that is changing the way governments,
    societies, and regular people work. It’s also sort of irritating that
    the most important thing to hit most people’s lives is also one of the
    most privacy invading companies in the world.

    After that I’d have to say the rise of automated operations and
    virtualized machines. Things like Xen, kvm, and even llvm as compiler
    infrastructure are changing how systems are managed and deployed, which
    then leads to bigger automation for large hetergenous networks. I’m
    sort of waiting for operating systems to catch up and realize that their
    configuration systems are getting in the way of real automation.

    Barce: Thanks again, Zed, for the interview. The take aways that I hope readers get from this are:

    • Zed has open source projects that free him from the normal interviewing process. Building your own open source project is one way to free yourself.
    • “Professionally though, inspiration is for amateurs and I just do my work.”
    • “[W]ork on projects at home,
      constantly look for new work, and move to where the work is.”
    • Facebook is the most disruptive technology that’s changing governments… Virtualization / Cloud technologies are a 2nd.
  • Django Follows the Law of Least Googling

    What web framework should someone new to web development learn?

    Any framework that follows what I call “The Law of Least Googling.” This law states that a tutorial will not let a learner have to Google anything for as long as possible and for as little as possible.

    I’ve followed the Django Tutorial all the way to the end. I did not use Google once, which means Django follows The Law of Least Googling.

    Because of this, I am now recommending that any person new to web development use Django.

    I used to think Rails was the way to go but because of the dependency mess with having to use Rake 0.8.7 to get RSpec working correctly, I am less inclined. Rails is a pain to install on Windows. You also have to google how to get the MySQL gem installed. This is not ideal when SQLite can’t get installed for some reason.

    But once you get Rails running it’s great, but as a newbie, I wouldn’t be surprised if lots of folks already gave up.

    Rails isn’t that bad. It hits these 3 snags:

    • Issues with SQLite3 or MySQL gem install
    • Creating sessions not working correctly with Rake 0.9.2. But There’s a patch.
    • It’s a pain to install on Windows, but I’m not really a Win Fanboy.

    Now if we’re talking LAMP, then forget it. It’s easy to get going with something like MAMP, or WAMP, but the frameworks simply don’t have that install and learn to code feel that Rails or Django has. You really cannot use a PHP framework without having to resort to Google very early. For example with CodeIgniter I have to figure out how to point my doc root correctly via Googling.

    My main take away is that if you want to learn to code on the web do it on Django. Python is the language that powers Django. There’s also a great Python tutorial to get you started.

  • I Did What I Loved and Nearly Destroyed Myself

    This is a polemic against the well-written blog post of Adam Conrad called “Do What You Love or You Will Destroy Yourself.

    The same warning that he applied to his post, I am applying here. There’s lots of stuff, but feel free to skip down to the useful bits at the end.

    I start off by presenting what I took away from Adam’s impassioned piece. Like me, Adam had an early career in computing. I wasn’t lucky enough to have the web be the thing when I turned 19, but I knew enough Perl to get a job coding at the university. I used Perl to create mailing labels that would be stuck on envelopes for snail mail.

    My aha moment came with a Perl-CGI freelance gig that I got in the 90s. I spent most of the 90s as a sysadmin. When I saw that my code was “live.” That was such a great high and experience. I felt powerful and influential, even though it was just a dentist’s website.

    In a similar “listening to my internship moment,” I decided working on the Internet was where I wanted to be. I took about 2 years from this aha moment until I code work as a coder.

    Where’s the problem?

    My true love in life is philosophy.

    For me this means reading and writing in a way that brings up questions and edifies, an existence that sees the beauty of a question not answered, a life that from a coder perspective is highly suspect and irrelevant. How many coders do you know *love* philosophy?

    I would honestly love to spend my days having sex, drinking coffee, reading, writing and more sex – with travel and several residences on the Mediterranean coast of Spain and Costa Rica (Pacific side), thrown in.

    I lived in such a way for nearly two years without the residences but with travel to London and Rome. The sad, sad truth of it is that there is no money at the end of it, and I ended up very much in debt and almost bankrupt. I just became credit card debt free 2 years ago after starting to learn about investing with mexc uk. *phew*

    If you believe that if you do what you love and you will save yourself, you are believing in something that is not true for everyone, and it wreaks of the Cargo Cult. What you love will not determine what makes you thrive; the world figures that out for you.

    There’s a bunch of Joseph Campbell crap floating around that goes, “Follow your bliss.” So many people have followed it blindly to their doom. But you know what? “Follow your bliss,” sells books because it makes people feel better.

    Let me leave you a quote from one of the great philosophers of the Golden Age of Advertising, Don Draper:

    “I hate to break it to you, but there is no big lie, there is no system, the universe is indifferent.”

    Here are the take aways and useful bits:

    • As a coder you have to be logical and realistic. Don’t let your sources of inspiration lead you astray.
    • Doing what you love can either make you thrive or ruin you. If it’s choosing between front-end or back-end dev, you’ll thrive either way right now. Think things through.
    • It is all about work-life balance but going all-in makes a great story.
  • Recruiting is Broken: The $2400 Face to Face Interview

    I lost a week of billable last week. That’s how much it costs if you go all out and turn on the recruiter fire hose.

    I got a face to face interview today. It was my $2400 face to face interview and I had to just turn it down because of the back log.

    Right now my clients are less than happy, and now it’s a serious difficult march to get stuff done.

    Now it’s great to be wanted, but to have that cost you money is pretty ridiculous. As a buyer, I shouldn’t have to spend money to buy what I want.

    Recruiting is seriously broken. Only one recruiter really served my needs. The rest of them seriously wasted my time and their clients’ time.

    What we need is technology to disrupt recruiting.

    Who is in?

  • What’s it like to be recruited?

    First off, I’m very grateful to my parents for getting me a computer when I was 8. I am not sure where I’d be if it wasn’t for that.

    I got inspiration from this HN article and did the same. My #s are way higher.

    http://news.ycombinator.com/item?id=2608900

    As an experiment, I submitted my resume to Dice, Monster and CareerBuilder seeking a Ruby on Rails application developer position.

    The result:

    day calls voicemails emails
    Monday 46 22 39
    Tuesday 58 13 42
    Wednesday 23 11 34
    Totals 136 46 115

    I turned off Monster, Dice and CareerBuilder at 11 am on Tuesday and I’m still getting calls & emails.

    Recruiters were submitting resumes to one particular job twice without my permission. This happened 4 times and is definitely unethical behavior. It hurts candidates because you can’t interview at these places anymore.

    The question I’ve asked is: How much are you willing to offer?

    Most of the jobs are in the 80k – 100k range.

    This means that if you got to a startup with no recruiter and are making 120k, the recruiter’s company is making 20k – 40k on the sale of you.

    The better recruiters have connections to companies mentioned in Techcrunch and these are at the 130k range and up.

    The best rates are at Fortune 500 companies, where 200k is market. Heck, you can get an HTML5 / CSS3 position at one and get that rate.

    Another question: How long has this job been advertised?

    Sure demand is high, but a great job will never be on the market long. If it’s been there awhile or has been re-branded with a different buzzword, beware.

    The technology:

    I totally agree with folks who say that Facebook has made us closer, but recruiting technologies and its industry have made hiring managers and candidates farther apart. Someone or a group of people need to create a technology to disrupt this industry of selling people.

    http://socialrecruitingreport.com/2011/06/02/removing-the-middle-man/

    Recruiters are people who are trying to solve a pattern matching problem with crappy tools, but the better those tools get, the more in jeopardy their jobs are.

    How I feel? I feel objectified. It’s hard to swallow the image of a bunch of douchebags submitting your resume for jobs you never applied for.

    I guess this is what it’s like to be extremely attractive woman who has just become single. Some of the recruiters are total players and won’t leave you alone when moving on would be more efficient and a better bet. Others are really, really bad, and you can tell they are reading lines from a script.

    The recruiters I go with work like this:

    1. They tell me *their* story. Why are they in recruiting? What do they want out of life?

    2. They really listen. This means asking questions like, “How is Javascript different from AJAX?” Or deciding that what is on paper doesn’t match what they are hearing, and that you’re underselling yourself.

    3. They get you lunch for your time. This is totally optional, but very nice.

    4. They wrap up the meeting by telling you something about you that you might’ve not known about. E.G. one recruiter told me that I saw myself as more than just my job and that I like to protect people.

    5. They are very efficient without seeming so.

    What to do instead:

    If finding a job is a pattern matching problem, and you are a coder, then code that regex that brings you the job of your dreams.

    You’re looking at 20k – 40k more / year if you can just cut out the middle.