Skip to content

Instantly share code, notes, and snippets.

View kannans's full-sized avatar
💻
☝️

Kannan S kannans

💻
☝️
View GitHub Profile
@kannans
kannans / Auto-complete-style.scss
Last active June 15, 2016 04:10 — forked from daz/style.scss
Bootstrap styling for jQuery UI autocomplete
.ui-autocomplete {
position: absolute;
top: 100%;
left: 0;
z-index: 1000;
float: left;
display: none;
min-width: 160px;
_width: 160px;
padding: 4px 0;
@kannans
kannans / Git Tricks.md
Last active December 7, 2015 04:16
Git tricks

If you dont have git just install:

sudo apt-get install git # in ubuntu
brew install git # in mac

1. Configure git shortcuts to make simple commands

@kannans
kannans / gist:edd2cc5977bc2d41bb39
Created October 7, 2015 11:15 — forked from bbugh/gist:3882746
Accessing alert box in JavaScript with Capybara/rails/rspec
//Get a reference to the alert using the following:
alert = page.driver.browser.switch_to.alert
// and then hit OK with
page.driver.browser.switch_to.alert.accept
// or dismiss it with
@kannans
kannans / capybara cheat sheet
Last active August 29, 2015 14:26 — 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')
@kannans
kannans / digital_ocean_setup.md
Last active August 29, 2015 14:26 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
Watch video here...
http://railscasts.com/episodes/347-rubber-and-amazon-ec2
@kannans
kannans / Ruby challenge.rb
Last active August 29, 2015 14:25
Ruby questions
1) What does the following code print?
p ["tommy", "chuckie"].map(&:upcase)
----------------------------------------------------------------------------------------------
2) Write a programe for this.
colors = ['red', 'violet', 'blue']
Use the colors array to construct the following array:
[['red', 1], ['violet', 2], ['blue', 3]]
-----------------------------------------------------------------------------------------------
3) Create an array of all the numbers between 1 and 100 that are divisible by both 3 and 5.
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
@kannans
kannans / Ruby program
Last active August 29, 2015 14:23
Script to write a program
1) Write a program to Read line from text and sort with number of lines
#sample.txt
"Its great"
"How are you"
"I am fine thank you"
"Hi Ruby"
@kannans
kannans / Bookmarks
Last active August 29, 2015 14:23
Bookmarks
https://www.airpair.com/js/javascript-framework-comparison
http://iarouse.com/dist-material-tf/v1.3/index.html#/forms/elements
http://www.frontcoded.com/rails-on-amazon-ec2-ubuntu.html
http://docs.aws.amazon.com/general/latest/gr/rande.html#ddb_region