Delete a directory recursively and forcefully. You have files in there, but you want to delete the directory -r: recursively -f: forcefully
Archive for the ‘Uncategorized’ Category
OS X Terminal Basics
Posted in Uncategorized, tagged basics, os x, terminal on April 22, 2012 | Leave a Comment »
heroku basics
Posted in Uncategorized, tagged basics, heroku, rails tutorial on April 22, 2012 | Leave a Comment »
Create an application on heroku This will create an auto-generated name. You can rename it to what you want. Then you can run db:migrate to create tables. You can check heroku logs, in case of any error
rails validation basics
Posted in Uncategorized, tagged basics, rails, rails tutorial, validation on April 22, 2012 | Leave a Comment »
Probably the easiest one, :length. You can give :maximum length.
Setting up ruby on rails on ubuntu
Posted in Uncategorized, tagged git, nautilus open terminal, rails, rvm, sublime text on April 19, 2012 | Leave a Comment »
First of all, I am following on-line version of rails tutorial (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2#top). Michael recommends sublime text 2 as editor. I use textmate on my mac, but I wouldn’t have the luxury of mac at work, so I am giving a try. open a terminal here Since I comes from windows background, I don’t like navigating in terminal. This [...]
Visiting Leeds Castle
Posted in Uncategorized, tagged leeds castle, tour on April 15, 2012 | Leave a Comment »
Used AirBnb. Staying in a local countryhome was a fantastic experience. My wife enjoyed it more than I did. Rented a car from Zipcar. It was very handy.
Git, Merging from Remote Branch
Posted in Uncategorized, tagged git, github on March 29, 2012 | Leave a Comment »
I did this on Bash on Windows 7 (64bit) against my github account. I tried to push my change to github, and found it’s not possible. Enter passphrase for key ….: To git@github.com:andrewchaa/JonSkeetCSharp4Examples.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to ‘git@github.com:andrewchaa/JonSkeetCSharp4Examples.git To prevent you from losing history, non-fast-forward updates [...]
Get ReSharper To Allow _ Underscore in Test Method Names
Posted in Uncategorized, tagged c#, Resharper, Unit Test on March 19, 2012 | Leave a Comment »
ReSharper usually doesn’t like it, but you can turn off the inspection for test methods. http://atombrenner.blogspot.co.uk/2010/07/how-to-change-resharper-naming-style.html Then you can do something like this.
RepositoryLocator, a variation of generic repository
Posted in Uncategorized, tagged Pattern, Repository Pattern, StructureMap on March 9, 2012 | 2 Comments »
I use StructureMap as IoC at work. I use it to get an object I need, and it is very handy. One night, while cycling home, I thought what if I can get repository in the same way I get object from StructureMap. I know there is a pattern called “Generic Repository”, but this is [...]
Undo git add before the first commit
Posted in Uncategorized, tagged git on March 9, 2012 | Leave a Comment »
As git newbie, this was very tricky but it happens quite often. You create a new project, say C# project. In case of rails, when you create a new project, it automatically creates .gitignore, but Visual Studio doesn’t. You do “git add . ” and suddenly you realise you staged so many unnecessary files like [...]
How to change default application in OS X
Posted in Uncategorized, tagged default application, ruby on February 28, 2012 | Leave a Comment »
Since I installed xcode, all my ruby files (.rb) opens in xcode by default. I much prefer textmate. To change the set default application, Select a file on Finder Right click to display the context menu and select “Get Info” In “Open with:” section, you can change the default application. Don’t forget “Change All…” to [...]