29 March 2013

TCS RSS Feed Reader 123


TCS RSS Feed
This is an iOS application build using

Running on Simulator/Device

You will need Rubymotion installed on your Mac.
  1. Clone repo git clone git@github.com:upadhyay-ashish/TCSRssReader.git
  2. Bundle gems bundle install
  3. Setup cocoapods pod setup
  4. Setup Developer license reference in the Rakefile
  5. To run on simulator rake else to run on a Device rake device
  6. To create a distribution IPA rake archive:distribution

25 February 2013

Replacing master with a branch GIT



This will help us to overwrite the master branch with a new branch incase the new branch is in a better state than the master


  • git checkout seotweaks
  • git merge -s ours master
  • git checkout master
  • git merge seotweaks



Thanks

08 January 2013

Using Oracle JDBC with JRuby on Mac OSx

Please follow the below steps to create a jruby library to connect to any oracle database on Mac OS x using Java ODBC drivers.


STEP 1: Create the Library folder and the Ruby file. eg Sample.rb
Step 2 : Add Gemfile to enable using jruby to connect to the database

Step 3 :  add the following gems to the Gemfile
gem 'activerecord'
gem "activerecord-jdbc-adapter"

Step 4 : In the ruby file Sample.rb here please use the following lines and then write appropriate  code to access the data.

class Person < ActiveRecord::Base

    establish_connection(
      :adapter  => 'jdbc',
      :driver   => 'oracle.jdbc.driver.OracleDriver',
      :url      => 'jdbc:oracle:thin:@server:port/sid',
      :username => 'ors',
      :password => 'ors'
      )

      self.table_name = :table_name_here

        def self.all

          connection.select_all <<-SQL
                  select * from table_name_here
             SQL
        end
 end

Step 5 : Go to terminal , run


bundle install 
jruby Sample.rb

Step 6 : If there is a driver not found error please download the driver from oracle site here 
and place it in /Library/Java/Extensions/ on your mac.

Have Fun !










22 October 2012

Cloning a specific GIT branch from a repository


Step 1 : Clone the master branch
git clone <repo master>
Step 2 : Clone the specific GIT branch
git fetch origin +branchname:branchname
Step 3 : Switch to the branch
git checkout branchname
Step 4 : Check the file difference between the master and the branch 
git diff --name-status master..sibos

28 September 2012

Migrating code from SVN to GIT

Install git-svn on ubuntu or linux

Simple command to begin with
$ git-svn clone <svn repo link> --no-metadata -s my_project

You need to do a bit of post-import cleanup. For one thing, you should clean up the weird references that git svn set up. First you’ll move the tags so they’re actual tags rather than strange remote branches, and then you’ll move the rest of the branches so they’re local.

To move the tags to be proper Git tags, run

$ cp -Rf .git/refs/remotes/tags/* .git/refs/tags/
$ rm -Rf .git/refs/remotes/tags

This takes the references that were remote branches that started with tag/ and makes them real (lightweight) tags.

Next, move the rest of the references under refs/remotes to be local branches:

$ cp -Rf .git/refs/remotes/* .git/refs/heads/
$ rm -Rf .git/refs/remotes

Now all the old branches are real Git branches and all the old tags are real Git tags. The last thing to do is add your new Git server as a remote and push to it. Here is an example of adding your server as a remote:

$ git remote add origin git@my-git-server:myrepository.git

Because you want all your branches and tags to go up, you can now run this:

$ git push origin --all

11 August 2012

Fix Readline error Ubuntu

Fix readline error with Ruby

sudo apt-get install libreadline-dev

cd ~/.rvm/src/ruby-1.8.7-p249/ext/readline

ruby extconf.rb && make && make install


Thanks