Posts

Export files between two git commits

 How to export or copy files between two commits, files those are added, modified, copied, renamed or type changed??? Its so simple and you can do this by only a single command

Direction Catastrophe

Image
  We are given directions to go from one point to another. The directions are "NORTH", "SOUTH", "WEST", "EAST". Clearly "NORTH" and "SOUTH" are opposite, "WEST" and "EAST" too. Going one direction and coming back the opposite direction is a wasted effort, so let's concise these directions to go the shortest route. For example, given the following directions: You can immediately see that going "NORTH" and then "SOUTH" is not reasonable, better stay to the same place!

ROT13 implementation in ruby

Image
We can implement ROT13 using map method and String.tr method collectively. Here is basic example