Skip to content

Instantly share code, notes, and snippets.

View rajeshthummalapally's full-sized avatar

Rajesh Thummalapally rajeshthummalapally

View GitHub Profile

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
#Activate the gem you are reporting the issue against.
gem 'activerecord', '3.2.11'
require 'active_record'
require 'minitest/autorun'
require 'logger'
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
@rajeshthummalapally
rajeshthummalapally / Mongodb
Last active December 12, 2015 04:28
Mongodb
show dbs #shows all databases
use db_name #use database with given name(creates if does not exist)
Basic Queries
db.user.insert({name: {first: 'Rajesh', last: 'Thummalapally'}, skills: ["Ruby on Rails", "jQuery", "CSS", "HTML5", "C#"]})
db.user.insert({name: {first: 'Teja', last: 'Thummalapally'}, skills: ["Ruby on Rails", "jQuery", "CSS", "HTML5", "Java", "Cooking"]})
db.user.find() #returns collection
db.user.findOne() #returns first one from collection
TO update a user:
class ActiveRecord::Base
def can_destroy?
self.class.reflect_on_all_associations.all? do |assoc|
assoc.options[:dependent] != :restrict || (assoc.macro == :has_one && self.send(assoc.name).nil?) || (assoc.macro == :has_many && self.send(assoc.name).empty?)
end
end
end
@rajeshthummalapally
rajeshthummalapally / capybara cheat sheet
Created December 4, 2012 15:53 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
Rajeshs-MacBook-Pro:graphviz-2.28.0 rajesh_thummalapally$ ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/graphviz/2.28.0 --with-qt=no --disable-quartz --disable-java --disable-ocaml --disable-perl --disable-php --disable-python --disable-r --disable-ruby --disable-sharp --disable-swig
checking build system type... x86_64-apple-darwin11.3.0
checking host system type... x86_64-apple-darwin11.3.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk