Put your message here! Contact me for more information
 
 







 

Archive for the ‘Random Walk’ Category


 

I’ll repeat it one more time, for my own sake:

Knowing where you’re going greatly increase your chances of getting there

Here’s the list of things I want to achieve in 2009, inspired by Marc-AndrĂ© Cournoyer’s post

2010

  • Get 5 accounts for my company, QuickSolution.com
  • Increase revenue of QuickSolution by $2,000/month
  • Be more thoughtful to help manage the QS team
  • Finish first beta of Marrily.com by September
  • Be ramen-profitable with Marrily.com by December
  • Getting more indepth knowledge of Rails
  • Being on the cutting edge of technologies. I will have to investigate more into new stuff, like XMPP, real time/streaming web
  • Be a more thoughtful and committed entrepreneur
  • Keep working with passionate people
  • Transitioning to working fully for myself
  • Get a MacBook (again) and develop 1 app for the iPhone and the iPad

Go boy, do it!

view comments
 

If you have to deal with multiple configuration values for different environments, this easy and very simple trick will let you put all these values to an external YML file and have a convenient global hash to access the values. Another benefit of putting config values in a YML file is that you can re-factor shared values into a default block, and override values in environment-specific blocks. You can keep your code DRY, now keep your config DRY as well, instead of littering your different environment config files.

In your environment.rb, add this one line between the Rails::Initializer.run do … end block

Rails::Initializer.run do |config|
  # ... other config code

  SITE_CONFIG = YAML.load_file(  "#{RAILS_ROOT}/config/site_config.yml" )[ ENV['RAILS_ENV'] || RAILS_ENV ]
end

Create a new “site_config.yml” file the /config folder using the following skeleton:

# config/site_config.yml

# the shared configurations.  Override values here in each individual environment.
defaults: &defaults
  twitter_username: your_username
  twitter_password: your_password

  # Blog
  blog_url: http://alexle.net
  blog_feed: http://alexle.net/feed/
  blog_email: 

development:
  <<: *defaults
  # override
  twitter_username: dev_username
  twitter_password: dev_password

slicehost:
  <<: *defaults

test:
  <<: *defaults

staging:
  <<: *defaults

production:
  <<: *defaults

Restart your web server so that the environment.rb file is picked up. Now within your code, you can access the values using

  logger.debug SITE_CONFIG["twitter_username"]

The only gotcha of this method is that we cannot override nested configuration blocks due to the way YML files are interpreted.

# this sample won't work
defaults: &defaults
  twitter:
    username:
    password:

development:
  <<: *defaults

  # this override doesn't work since it replaces the twitter hash in the defaults block with a new
  # hash containing only the "username" key (The "password" key-value is gone!)
  twitter:
    username: dev_username

cheers!

view comments
 

My good friend Stephen Celis convinced me to give Rails.vim a shot for Rails development. My vi skill is not that great yet (e.g. beginner level), so Stephen recommended vimtutor, which does not come pre-installed on my CentOS server. So here’s a quick recap of getting vimtutor installed:

1. Installing “which”, which the vimtutor script uses to detect the vi version and copy the vimtutor script accordingly.

sudo yum install which

2. Installing “vim-enhanced” package, which contains the vimtutor

sudo yum install vim-enhanced

Now you should be able to do “vimtutor” and start a new vimtutor session. Happy h-j-k-l around and stops using the arrow keys :)

view comments
 

It’s been a long time since my previous post. There was a lot that has happened (and not happened). I switched my job from being a consultant at BridgePoint Technologies, a small consulting firm in Oak Brook, to being a lead developer at Designkitchen.com. I love the team at BridgePoint, I learned and grew a lot during my time there, and of course I always remembered to have a good time wherever I go to. I had a blast, and I still keep regular contacts with friends and colleagues there. The new position at Designkitchen is also awesome in the sense that it offers new opportunities, new challenges, and a new environment. And I find life is funny in its own way. BridgePoint’s office is right across the street from the McDonald’s HQ. I used to walked across the street to lunch with friends to the yellow McDonalds restaurant near by, which impressively has a timer to tell how fast each customer is served. The average was about less than 40 seconds. Joining us were also McDonalds corporate employees grabbing a quick bite. Was it one more reason to get back to work faster to climb the corporate ladder? Anyhow, I’m currently the lead developer for ClubBK.com, a Burger King’s effort to get their presence on the so-cool cyberspace for kids. Never did I feel more like having burgers for lunch everyday. Nonetheless, I’m having a blast working side by side with the different teams at Designkitchen. Everyday is a learning experience.

I picked up a Canon Digital Rebel XSI with a 50mm f/1.4 prime lense. I knew nothing about photography, and now is always a good time to start picking up a new hobby. My grandfather is really good photographer, and I don’t want to see him disappointing that his grand kid is being ignorant of the art. I’m not. I just never had the budget ready for such a plunge. But I’m glad I did it. The XSI is an excellent camera — light, compact, good build, and cheap. Coupled with the fast f/1.4 lense, I’ve had some good (or lucky) shots of people at really low light conditions. Everybody was impressed with the photos, without knowing about my newbie status.

I also got a new Mac Book Air with 64GB SSD for rails and iPhone apps development. Designkitchen is a heavy Mac environment. Almost 100% of the creative team is on Mac (clubBK.com is 100% mac, that’s for sure), and most Rails guys I know are also on Mac. Not that I’m being influenced by peer-pressure, but definitely that counts for something. I’ve been using the Air for a straight 2 days, leaving my Dell D830 in the backpack. Heck, I don’t need a backpack for the Air! Performance wise, the machine is zippy and Rails 2.3.0 boots in merely seconds. I managed to consume more than half the 64GB with the iPhone SDK and OS X updates, but I still have plenty of room left. I have all my media on the main desktop, and for music, Last.FM and Pandora provide some awesome head-banging time when I’m not home (try some Disarmonia Mundi and you’ll know what I mean). In other words, I’m getting macimized while staying anti-vista.

I’m saving the best for last, but I’m finally free. 2.10, the day to remember. I’m so ready to have my life back. Time to make some changes and live life a bit, as I’ve been in the shadow for way too long.

view comments
 

I don’t like to get political on my blog, but a friend of mine sent me a link to a political quiz at ABCNews.

http://abcnews.go.com/Politics/MatchoMatic/fullpage?id=5542139

Here are my answers:


mccain-obama

I don’t disagree with some of the things that Obama is saying, but I strongly agree with McCain’s principles and leadership. And as a foreign immigrant to this country, I’m strongly offended by Obama’s way of dealing with the issue:

Obama: “We should require them to pay a fine, learn English, and go to the back of the line for citizenship behind those who came here legally. But we cannot — and should not — deport 12 million people.” (number #8)

Who the hell is Obama to say “let’s fine these illegal immigrants because they just sneaked in the country?” JERK, JERK, and JERK. How about babies that were brought to the States by their parents, granted “illegally” according to US’s immigration laws. Do these babies do anything wrong to get fined? They speak English, pay taxes, go to school, and contribute to society as much as anyone else — while getting treated as a 2nd-class citizen.

McCain has a much clearer policy and it is towards an legalizing the integration of the immigrants (currently there’s no such thing!)

“The program will … ensure that all undocumented aliens either leave of follow the path to legal residence. American cannot permit a permanent category of individuals that do not have recognized status — a permanent second class”

McCain, I wish you the best of luck!

view comments