RVM Setting the default Ruby

2017-06-12 04:32:02 +0000

If you would like to make one specific Ruby be the default ruby that is selected when you open a new terminal shell, use the –default flag:

$ rvm --default use 2.1.1

$ ruby -v

ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]

The next time you open a window Ruby 2.1.1 will be the selected ruby.

To switch back to your system ruby:

$ rvm use system

$ ruby -v

ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

To switch at any time to the ruby you have selected as default:

$ rvm default

$ ruby -v

ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]

To show what ruby is currently the selected default, if any, do:

$ rvm list

rvm rubies

 * ruby-1.9.3-p484 [ x86_64 ]
   ruby-2.0.0-p481 [ x86_64 ]
=> ruby-2.1.1 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

If you wish to switch back to your system ruby as default, remember that RVM does not “manage” the system ruby and is “hands off”.

This means to set the “system” ruby as default, you reset RVM’s defaults as follows.

$ rvm reset

Note that “default” is merely implemented as an alias with an especially significant name.

If you encounter an error such as “RVM is not a function, selecting rubies with ‘rvm use …’ will not work.”, try using the alias action instead:

$ rvm alias create default 2.1.1

A silly idea to compare Jekyll vs Octopress

2017-06-07 14:16:07 +0000

Before switching to Jekyll, I tried out Octopress, a blogging framework built on top of Jekyll…. I was really surprised to find out how much I disliked the experience with Octopress. I had an impression that it is a hacker friendly, simple and extensible blog platform, but it was the opposite of that. There are many layers of abstraction, themes are pretty complicated, it comes with many … pre-installed plugins out of the box, dozen depedencies (ruby gems), it uses Sass by default and so on. A fresh copy of Octopress blog consists of staggering 29 directories and 144 files it’s too much..!!

Octopress works almost ok if you are willing to invest plenty of time to customize it or need to build something complex, but it wasn’t my particular use case. The complexity of Octopress defeats the whole purpose of a simple, generated static site. But you know what is “hacker friendly, simple and extensible blog platform”? That’s Jekyll! Jekyll is dead simple and practical. It was a pleasure to setup and customize the default theme. It took less than an hour to have a fully customized blog just the way I wanted. So I am staying with Jekyll this time. The directory structure is really simple and you start with the bare essentials, a simple layout and a CSS file. That’s it!

I tend to prefer simplicity and unix-like philosophy when it comes to choose every day tools for specific tasks. I can always extend, build and combine on top of that, when the time comes.

you can install jekyll with a simple command :

$ gem install jekyll

Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo. If you have questions, you can ask them on Jekyll Talk.

Viewing the Git log

2017-01-27 14:52:19 +0000

This list isn’t complete, but the commands shown here are the handful that I use on a day-to-day basis. They should all work in a recent version of git on Linux or macOS (I don’t have access to a Windows computer anymore, but if you know something I don’t, please leave a comment and I’ll amend this article).

  • git log: On its own, git log displays a list of commits and their commit messages in reverse chronological order (most recent commits at the top).
  • git log --reverse: Display the output in reverse, so the earliest commits appear at the top of the output.
  • git log --oneline: Passing --oneline results in a terse, two-column list of commit titles and SHA identifiers.
  • git log -p: Passing the -p flag adds a full patch, or diff, to each commit–the code you added and removed.
  • git log -p <filename>: Passing a file name restricts log output to changes to that file (for example, git log -p app/models/user.rb). You can remove the -p flag if you don’t care about the code changes in each commit, or use --oneline instead to get a quick list. I find that I’m almost always interested in the actual code changes, though. If there’s a chance that git could confuse the filename for a branch name, include -- to disambiguate (git log -p -- app/models/user.rb).
  • git log -p -S <query>: Use the -S flag (also known as the git pickaxe) along with a search term to restrict log output to code changes matching the search (for example, git log -p -S password). Again, this will work without -p, or with --oneline, but this is how I typically use it.
  • git log -p --grep <query>: The --grep flag searches only the commit messages for the provided query. Wrap the query in quotes if it contains spaces. (You and your team are hopefully writing useful commit messages!)
  • git log <commit1>..<commit2>: Restrict output to only the differences between two specific commits by passing them with a .. (and no spaces) between them. This works with SHA identifiers (git log 660bfa2..922b5d2) as well as branch names (git log rails-4.1..rails-4.2). Leave either side blank to imply the current branch (git log rails-4.2..). Use with -p, -S, and --grep as outlined above to filter the results further.
  • git log --stat: Add a brief list of the files that were altered in each commit, with a count of lines that were added or removed. As you may have guessed by now, --stat can be used alongside the other flags listed here to narrow results.
  • git log --no-merges: Omit merge commits from the log output (use --merges to show only merge commits). I don’t use these as often.

As I mentioned, this is just a list of the tools I use most often to look at the git log. If you want to learn more, Atlassian’s article on advanced git logging is a great next step.

Projectile makes your Emacs very fast!

2016-04-09 15:49:07 +0000

Projectile makes your Emacs very fast…!!! after installing projectile in Emacs… It was easier to search and fin files within directories quicky projectile replaces command palette of Sublime Text Editor!

You Know … I recommend Projectile !! for more info visit :

Projectile Repo Github

See you next Article ..!! Tinix!

Install and config neotree on Emacs

2016-03-28 00:00:00 +0000



You can install the plugin using the packages on melpa.

Make sure you have something like the following in your Emacs startup file (~/.emacs.d/init.el, or ~/.emacs):

    (add-to-list 'package-archives
                 '("melpa" . "http://melpa.org/packages/"))

To make that take effect, either evaluate that elisp expression or restart Emacs.

Then use M-x package-list-packages, select neotree from the list by pressing i, then press x to execute the changes. At that point, the package will be installed.


Clone project:

$ cd /some/path
$ git clone https://github.com/jaypei/emacs-neotree.git neotree
$ cd neotree
$ git checkout dev

Add config to emacs:

(add-to-list 'load-path "/some/path/neotree")
(require 'neotree)
(global-set-key [f12] 'neotree-toggle)

Open (toggle) NeoTree:




emacs-neotree is running!

subscribe via RSS