Author: barce

  • The Most Popular Cat on Instagram Faces Castration

    On Instagram, the wildly popular app, and iPhone app of the year, there’s an account run by Afra. She has a cat named Uncle Liu. Apparently, this awfully cute cat will get castrated unless… well, check out the picture of the cat below and then the note Uncle Liu’s owner left.

    Can you help? It looks like the only way to get in contact is on Instagram.

  • Upgrade Your Rails Facebook App to SSL

    On October 1st of this year, Facebook will be requiring that all apps on Facebook must support HTTPS (SSL).

    I’ve provided a guide below which I’ve used for apps I’ve worked on that are Rails based.

    This guide shows you how to change your Rails Facebook App into an app that supports SSL using Passenger and Apache2.

    Step 1: Get an SSL cert or roll your own.

    Dreamhost.com made it very easy to add an SSL cert for just $15.00 / year.

    I tried out my app out using a locally signed certificate which seemed to work just fine:

    openssl genrsa -des3 -out server.key 2048
    openssl req -new -key server.key -out server.csr
    cp server.key server.key.org
    openssl rsa -in server.key.org -out server.key
    openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

    Step 2: Install and compile Apache 2

    Get the latest version of Apache: http://httpd.apache.org/download.cgi.

    Configure and compile Apache:
    ./configure –prefix=/usr/local/apache2 –enable-rewrite –enable-so –enable-ssl
    make && make install

    Step 3: Configure your Rails app

    gem install passenger
    passenger-install-apache2-module

    Step 4: Edit your Apache 2 config files:

    Edit httpd.conf. For example:

    LoadModule fcgid_module modules/mod_fcgid.so
    LoadModule passenger_module /Users/jimbarcelona/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
    PassengerRoot /Users/jimbarcelona/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8
    PassengerRuby /Users/jimbarcelona/.rvm/wrappers/ruby-1.9.2-p290/ruby
    
    
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    
    
    Include conf/extra/httpd-vhosts.conf
    Include conf/extra/httpd-ssl.conf
    
    
    IPCCommTimeout 40
    IPCConnectTimeout 10
    
    # TODO: change this to production if you are on production
    DefaultInitEnv RAILS_ENV development
    SocketPath /tmp/fcgidsock
    
    

    Edit extra/httpd-vhosts.conf:

    
      ServerName berkeley.l33tcave.com
      ServerAdmin wwwadmin@berkeley.l33tcave.com
      DocumentRoot /Users/jimbarcelona/rails_apps/github/hipsterhookups.com/public
      ErrorLog /usr/local/apache2/logs/rails_error_log
      RewriteEngine On
      
        AllowOverride All
        Options -MultiViews
      
      RailsEnv development
    
    

    Edit extra/httpd-ssl.conf:

    #   General setup for the virtual host
    DocumentRoot "/Users/jimbarcelona/rails_apps/github/hipsterhookups.com/public"
    ServerName berkeley.l33tcave.com:443
    ServerAdmin you@example.com
    ErrorLog "/usr/local/apache2/logs/error_log"
    TransferLog "/usr/local/apache2/logs/access_log"
    
    # needed for rails
    Options Indexes ExecCGI FollowSymLinks
    RewriteEngine On
    RailsEnv development
    
    
    AddHandler fcgid-script .fcgi
    
      
        AllowOverride All
        Options -MultiViews
      
    

    Be sure to add your SSL certs in the httpd-ssl.conf too!

    Step 5: Start Apache

    # check syntax
    apachectl configtest
    # start apache
    apachectl start

    Step 6: Go to facebook and use https for canvas URLs

  • Low Status and High Status Technologists

    There are many technology companies where the coders are low status. A good example of one is Yahoo. Paul Graham points out that Yahoo tried to spin itself as a media company where flashy sales guys and executives in suits tricked the company out of the importance of technology.

    Coders as low status is the rule in most US companies except for maybe the Silicon Valley.

    What do I mean by low status? Don’t coders make better than average wages? I am not talking about raw capital here. I am talking about social and “track record” capital which are both zero sum games.

    I am talking about who gets invited to social events reserved for elites in a city like Los Angeles and who doesn’t. Very few techies in SoCal are part of that social register. In San Francisco, it’s very different. You can be a techie like Marissa Mayer, and on the red carpet and have people comment on your awesome date or outfit.

    On one side you have a company run by technologists and on the other you have a company run by everyone else.

    Manipulating computers is “easy.” They simply are not as smart as we are. Manipulating people is hard, and actually the best manipulators are the ones who don’t show themselves to be that. When a product is technology, you have to wonder about the folks doing the “hardstuff,” the manipulating of people. Is it really contributing to the product or are they using their gift to create an inequitable, and in the case of Yahoo, profit ruining situation?

    My personal bias is that technologists should rule a company. I’m completely in line with Mark Suster when he writes that the startup that’s most worth funding is all technologists. My reasons for this build upon Mark Suster’s in that you don’t have to “translate things into English.” It’s kind of insulting when I hear the phrase “translate things into English.” It puts the blame on the person on the team most equipped to solve the problem. The person, who wants “things translated into English,” is the problem, not the coder.

    A company where coders do not have to translate into English and just can talk about solving technology problems in order to get the highest ROI possible is the most efficient. Be sure to maintain a good reputation online to attract potential clients. A company specializing in online reputation management for individuals can help in this regard.

    Maybe with such a dynamic it’s no wonder most of the prestigious families in the US still think a career in tech sucks.
    So if you are looking for work as a coder, how do you tell if your work will be considered low status or high status work?

    • Does the CEO have a technical background? If she does, you’re in for some fun and get to call many of the shots in the same way coders at Facebook can.
    • Does the software process *not* rely on rock stars? If one person is the key to fixing many issues, it is a sign of a software process gone awry. This is how Facebook ships code, and it’s worth a critical read.
    • Is there talk of outsourcing?

    Unfortunately, only 1 of the 3 things listed above can be found out during the interview process. If you’re at a company where coding is considered low status, what can you do? Stay tuned for my next blog post.

  • 25 super engaged followers thanks to BestCoworking

    This is a quick plug for the BestCoworking group on Facebook. I got 25 really super engaged and diverse followers in about 1 hour of engaged social media effort. I skipped lunch, and it was worth it!

    I want to thank Stacey Soleil for putting this group together.

  • Setting Up Cucumber and RSpec on Padrino

    This is a quick guide on how to set up Cucumber and RSpec on Padrino.

    I’ve created a simple test app on github that reflects the steps written down here.

    1. Create the app:

    padrino g project todo -t cucumber -d sequel -b

    2. In the Gemfile use rake 0.8.7:

    gem 'rake', "0.8.7"

    3. In features/support/env.rb comment out “require ‘spec/expectations’” so it looks like:

    # require 'spec/expectations'

    At this point ‘cucumber features’ should work and should return a failed test for adding two numbers.

    Also at this point, if you create any models, then bare specs for them will be created in the ‘spec/models’ folder.

    Please feel free to leave questions or comments if you’ve got a different way of setting things up on Padrino.

  • 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!