Introducing Chit – the only Cheat Sheet you’ve ever need

Jun 21 2008 Published by under English,Mac,OS X,Ruby

It was yesterday, one news in my GitHub feeds which really has got my attention:

defunkt started watching chit 1 hour ago

Who is defunkt anyway? Chris Wanstrath, the guy who sits behind ErrTheBlog, GitHub, FaceBox, Cheat and lots of other cool stuffs.

So, there has to have something really good in Chit! I took a quick look into it and found Chit is really Awesome!

Chit

Chit is a command line cheat sheet utility based on git.

AUTHOR: Robin Lu. Thank you, Robin!

FEATURES:

Chit was inspired by ‘cheat’ by Chris Wanstrath. You can use chit to access and manage your cheat sheets easily.

There are several differences between ‘cheat’ and ‘chit’. By using chit, besides the wonderful features of ‘cheat’, you get:

1. Git powered cheat sheet repository. You can specify where you get the sheets and where to share them.
2. Your own private cheat sheets. Everybody has some project related or smoe cheat sheets which are not mean to public. You can also put them into chit
3. Directory support. You can group cheat sheets by directory now.
4. One less letter to type.

REQUIREMENTS:

rubygems (You already have, don’t you?!), git (sudo gem install git) and hoe (sudo gem install hoe)

INSTALL:

sudo gem install robin-chit -s http://gems.github.com

USAGE:

To get a feeling about chit:

$ chit chit

To get a cheat sheet:

$ chit [cheatsheet]

If it does not exist, a new one will be created and waiting for your editing. Leave it blank and quit the editor if you don’t want to add a new one.

To edit a cheat sheet, use the—edit switch.

$ chit [cheatsheet] –edit

To add a cheat sheet, use the—add switch.

$ chit [cheatsheet] –add

During editing a cheat sheet, empty the content will get the cheat sheet removed.

A prefix ’@’ indicates the cheat sheet is in private mode. A private cheat sheet is kept in another repository.

To get a private cheat sheet:

$ chit @[cheatsheet]

The prefix ’@’ works the same for both—edit and—add.

The cheat sheet can be in a path. For example:

$ chit mysql/select

will get the cheat sheet ‘select’ under mysql.

To show all the cheat sheets:

$ chit [all|sheets]

To show all the private cheat sheets:

$ chit @[all|sheets]

To search cheat sheets begin with ‘name’, use the—search/-s switch

$ chit name -s

SHARE:

Thanks git, shareing cheat sheets has never been such easier.

After the first time running chit, chit will create 2 local git repositories:

  • ~/.chit/main, which will pull out the default cheat sheets repository from http://github.com/robin/chitsheet
  • ~/.chit/private, which will be empty and wait for you to fill it out all your private goodies

After that, they are all yours. You can use git to do all the fancy things: push to a shared server for your team, push to github repo share with us, pull from some other shared place…

WANT TO KNOW MORE:

Chit GitHub Repository

Chit GitHub Wiki – Most of this post is copied from here.

chit – 基于git的cheat sheets工具 – Only if you can read Chinese

chit – cheat sheetsnowa forked chit and added custom repository config support – It was wrote in Chinese too.

Cheat + Git = ChitChris Wanstrath @ GitHub

WHAT’S NEXT?

Chit and share your sheets!

6 responses so far

RailsConf 2008 Summary and Review

Jun 11 2008 Published by under English,Ruby,Toronto

We three of us in Learnhub, Wesley Moxam, Carsten Nielsen and my self have attended RailsConf 2008 last weekend. It was a great event for sure. After came back, we did a presentation for Toronto Ruby on Rails Project Night yesterday. Here is the presentation file which we’ve used:

More details are on LearnHub Rails Community:

RailsConf 2008 Summary and Review

No responses yet

DHH & Libin

Jun 03 2008 Published by under English,Ruby

DHH & Libin, originally uploaded by Wes and Faye.

Thanks to my dear co-worker Wesley took this nice picture for me!

It was after David has finished his Keynote in RailsConf 2008.

No responses yet

RailsConf 2008

May 29 2008 Published by under English,Ruby

Stay tuned! More details about RailsConf 2008 will be here soon.

See you in Portland! :D

One response so far

(Re)Enable TextMate Ruby Bundle

May 11 2008 Published by under English,Mac,Ruby,Software

We all love TextMate, by all means. It is the best friend for Ruby Developers.

After our project upgraded to Rails 2.0+ at LearnHub.com, I noticed that there are some very powerful Ruby Bundle Commands just stopped working. Especially these two:

  • Run Focused Unit Test

This is an awesome lovely command in Ruby Bundle, absolutely my favorite! It allows you to run a single unit test out of a whole suite of tests by simply positioning your cursor into the test you’d like to run.

  • Run Rake Task

This is another cool command too. It shows a popup window which list all the available rake tasks you have and it will show a pretty HTML result window after you choose from the list.

This thing really bothers me a lot. I could be fine for the second one, as I do have terminal windows open all the time. But I really really miss the first one, as our test files get longer very soon.

I have to make it work!

After couple of hours trying today, I’ve pretty much got the right reason and the simple solution, for now.

The reason is that TextMate includes its own version of builder.rb, which is conflicting with Rails 2.0′ version of builder.rb.

The simple solution:

  1. Open TextMate Bundlers Editor
  2. Find Ruby -> Run Focused Unit Test
  3. Search for RUBYLIB=”$TM_BUNDLE_SUPPORT/RakeMate${RUBYLIB:+:$RUBYLIB}”
  4. Change to RUBYLIB=”$TM_BUNDLE_SUPPORT/RakeMate”
  5. Reload Bundlers

That’s it! And apply the same changing method to other commands such as “Run Rake Task” as well.

And just want to point out the alternate solution is:

mv /Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb /Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb.bak

It’s up to you to choose one of them.

Hope Google can pickup this post quickly so we can save somebody else sometime too. :)

Enjoy!

3 responses so far

Nested Namespace in Rails 2.0

Apr 13 2008 Published by under English,Ruby

$> mate config/routes.rb

map.namespace :admin do |admin|
  admin.resources :user
end

$> rake routes

admin_user_index GET    /admin/user
  {:controller=>'admin/user', :action=>'index'}
......

$> mate config/routes.rb

map.namespace :admin do |admin|
  admin.namespace :user do |user|
    user.resources :profile
  end
end

$> rake routes

admin_user_profile_index GET    /admin/user/profile
  {:controller=>'admin/user/profile', :action=>'index'}
......

No responses yet

Update RubyGems to new Version on Leopard

Apr 03 2008 Published by under Apple,Mac,OS X,Ruby

RubyGems just updated to version 1.1.0. Couple of the major changes are “Index updates are much faster now” and “only updates from a latest index by default”. So, time to update.

As Leopard already has Ruby and RubyGems preinstalled (Thanks, Apple!). So the default update way:

$ sudo gem update –system

will NOT work well.

Here is what you should do on Leopard 10.5.2:

$ sudo gem install rubygems-update
$ sudo update_rubygems

Enjoy!

8 responses so far

First day in LearnHub

Mar 17 2008 Published by under English,Ruby

Today is the day!

It’s my first day in LearnHub. Pretty exciting! Time to have fun with Ruby on Rails fulltime!

Here is our development team at March 17, 2008:

Want to know more?

No responses yet

« Prev