Rails 3 Documentation: Generate Your Own
In this screencast, I show you how to generate the api and guides for offline viewing.
Rails 3 Documentation: Generate Your Own from Joon You on Vimeo.
Pomodoro Technique
As long as I can remember, even when I was a kid, I always used 50/10 technique. If you don’t know what that is, it’s focusing intensely and working on a task for 50 minutes and take 10 minute break. I did this unintentionally and when found the “official” technique, it basically confirmed my belief that this is what made me very effective.
I then found another technique, Pomodoro. It’s basically the same as the technique I mentioned, but it’s broken down to 25 minutes and 5 minute break. I was shocked to find that it’s highly effective, and it’s even more enjoyable.
To learn about this, you can read the free book at http://www.pomodorotechnique.com . Listed in posts are the resources I found helpful.
Videos
The Pomodoro Technique: can you focus – really focus – for 25 minutes? – Staffan Nöteberg
Software
- On my Mac, I use Pomodoro Desktop and always have it on when my computer starts. It’s simple and free.
- On Linux, I just use timer applet and have three presets; pomodoro, short break, and long break. Because I use 64-bit version, I found too many issues with any AIR based apps.
Installing Redis on Mac Snow Leopard
Here’s how I do it.
Step 1 – Get the source and compile it
Step 2 – Place the binaries and configure
- copy redis-benchmark, redis-server, redis-cli, and redis-stat to /usr/local/bin and set the owner to root.
- copy redis.conf to /usr/local/etc and change “daemonize” to “yes”
- if you want it to start when the system boots, create redis.plist in ~/Library/LaunchAgents directory with following content:
Then use the following command to automatically start when your computer boots:
Step 3 – Test
- open Redis CLI by entering “redis-cli”
- open Redis CLI again
Structure and Interpretation of Computer Programs
*** Update ***
Forget curl, just download and install wget => “If you’re using a Mac and don’t have wget installed, then replace wget with curl -O”
***
Now that the videos are fixed, I was watching Jim Weirich’s keynote at this year’s Red Dirt Ruby Conference. He mentioned the book “Structure and Interpretation of Computer Programs” and what he was doing with it. So I got really interested.
Before I go any further, I don’t have a “computer science” background. When I started computing, there weren’t much and I did things without knowing the name. Take TDD for example. I always thought that people programmed that way and as far as I’ve seen, all the “old” people did it that way. What offends me the most is some asshole comes along and puts a label on it and I’m suppose to know what that is.
Ok, back to the subject at hand. You can purchase this book for $68 or view it online for free at HERE. You can also get the video of the course that uses this as the text from MIT’s Opencourceware by running following script I wrote for you. Here’s the link to MIT 6001.
First run the script below.
Then run the following script to clean up the file name.
The primary reason why I go through the beginner’s stuff is that whenever I go into an interview, I get asked basic computer science questions because people interviewing me never worked on any real applications and the only thing they know is what they learned from school.
In any case, this surely is an interesting exercise and I’m enjoying it.
Ruby-Debug19 with Ruby Head
Just in case you didn’t know by now, true to my name, I use HEAD version of Ruby. That’s 1.9.2dev at this time, and I already made a post on how I compile it from the source here.
Ruby-Debug is one of my indispensable tool. I’d be lost without it along with all the testing framework. You see, I really don’t know how to develop without testing and debugging. I’m a devoted Catholic so my faith is unshakeable, but that’s the religion, not the code.
I was going to give up on the latest Ruby because I had a bitch of time trying to install it. Well, it turns out that I was making a stupid mistake and although I feel embarrassed to admit, I’ll post the instruction here.
To install ruby-debug19, do the following:
That’s all! I was keep pointing to a wrong directory. This is a good reason why you shouldn’t remove the source directory after you compile and install Ruby.
Ruby Method Name with Spaces
This is an introduction to Ruby metaprogramming where I cover two different ways to define a method. The idea actually started as a joke, but there are valuable lessons to be learned here.
Ruby Method Name with Spaces from Joon You on Vimeo.
What’s The Name of Method?
Someone asked me today how do I find out what method the current line of code is in during the runtime. Besides the obvious question, I nevertheless thought that it’s interesting that Ruby provides with that information.
Take a look at the code below.
The output is “hello”, which happens to be the name of the method that was called. If you do “__method__.inspect”, then you’ll get :hello instead of the String version.
Super Micro Web App – from my Rack presentation last year
__FILE__
What does the following get you?
Can you guess where the file is located?
The Latest Ruby
Are you brave enough to run the latest version of Ruby from trunk? Well, I do that on my development machine, because a) I lost my mind, or b) I’m the bravest man alive!
Well, all jokes aside, I thought it would be interesting to post how I do it. Obviously, I use Ubuntu to do this, usually in a virtual machine. However, this is not the case for my Lenovo X200. Before you do anything, make sure all the normal tools and libraries such as readline, zlib, ncurses, iconv, and etc are installed, especially the “dev” packages. In addition, run following:
Now that you’re armed and dangerous, let’s install by compiling as we normally do.
Just few notes/caveats:
- I’m assuming that you did not install Ruby yet, because this will override your existing installation.
- If you want to install it elsewhere, then change –prefix=/usr to somewhere else. I usually do “–prefix=/home/{your name}/.rubyhead” and remove “sudo” in make install. Then will change my $PATH.
- You may have to install openssl by “sudo apt-get install libssl-dev”
- Always go to “ext” directory and install each missing/broken extensions.
