Shiva Kumar 's Blog

Start small,Think Big


Basic Vim commands – For getting started

Repost of the article which I wrote a long ago in coderwall and got quite popular among the community. 1. Insert mode (Where you can just type like normal text editor. Press i for insert mode) 2. Command mode (Where you give commands to the editor to get things done . Press ESC for command […]

Postgresql Basic Tutorial (Part I)

Creating a database in PostgreSQL Dropping a database Connecting to database The above command will give you access to the database once you are inside you can run the following commands. To get help on certain commands. \l -> returns list of database \dt -> returns list of tables \du  -> returns list of roles […]

Document classification using Python and Scikit

Recently i have been working on an interesting problem, in which i wanted to classify the document we are passing. Doing it manual could be a big pain since there 1000 of a document we want to classify on the daily basis, how about we can automate it with using machine learning. Even though I tried […]

, ,

Journey gem error while setting up rails source

So i recently i forked and cloned the rails repository and was following these steps So when i was is doing bundle install –without db i was getting this error Could not find gem ‘journey (~> 1.0.1) ruby’, which is required by gem ‘rails (>= 0) ruby’, in any of the sources if you […]

Rails 4 new features

In this post will be explaining some new stuffs ,changes and deprecation in rails 4 Lets start with concerns.In Rails 3, as you can see comments and tags are nested routes for coupons and posts which has a quite of lot duplication in code resources :coupons do resources :comments resources :tags end resources :posts do […]

, ,

Struct in Ruby

Struct is a simple way to create a class with number of attributes without explicitly creating a class Syntax to create a class using struct 1.9.2p290 :004 >“User”,:name,:email) Where User is the class name.Name and email are the attributes of the class where passing it on the fly. So when you want to create […]

, , , , ,

Tagging with jquery tokeninput and ActsAsTaggableOn gem

Tagging  has become important part of most the application,so that we can easily filter out the post or content according to the category or  type. Today im gonna run you through how to build a tagging system.Which i recently implemented using jquery tokeninput and ActsAsTaggableOn gem .Tokeninput is jquery plugin which uses to select mulitple item from predefined list […]

, , , , , , ,

Rails Application structure

A brief explanation of rails application structure .i.e what folders and files are  created by rails when type the rails new app_name command Assets – This is  where you have all your static files like image,stylesheets,javascript these are compiled by sprockets.when deployed these are served from /assets directory Controller -This is where all your controller goes which […]

, , ,

Modules and Mixins

Ruby support inheritance,child class have all the property of parent class and access to their  methods.Some call parent class as superclass and child  as subclass.Below is the simple example for inheritance .In ruby we use less-than notation like Child < Parent like parent class pushing all the property to the  child.There is nice way to see the […]

, , ,

Expired SSL certificate throws some errors on 1.9.3 install

so if your  doing a fresh install of ruby-1.9 or later version using rvm and if you run through this error here is the solution that may help. I searched a lot .And i found the best result in github rvm repo 0curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL […]

, , ,

Previous Posts