Skip to content

Instantly share code, notes, and snippets.

Abdul Shajin abdul-shajin

View GitHub Profile
View gist:d949022cb6b2bdaedffa56daabc6a6a2
Building native extensions. This could take a while...
Successfully installed capybara-webkit-1.15.1
Parsing documentation for capybara-webkit-1.15.1
Installing ri documentation for capybara-webkit-1.15.1
Done installing documentation for capybara-webkit after 0 seconds
1 gem installed
shajin@Abduls-MacBook-Pro manufacturer (BUGS-7095) $ bundle install
Fetching source index from https://gems.contribsys.com/
Fetching source index from https://gems.contribsys.com/
Fetching gem metadata from https://rubygems.org/.......
View with-place_id.json
{"html_attributions"=>[],
"result"=>
{"address_components"=>
[{"long_name"=>"Bhiwadi", "short_name"=>"Bhiwadi", "types"=>["locality", "political"]},
{"long_name"=>"Alwar", "short_name"=>"Alwar", "types"=>["administrative_area_level_2", "political"]},
{"long_name"=>"Rajasthan", "short_name"=>"RJ", "types"=>["administrative_area_level_1", "political"]},
{"long_name"=>"India", "short_name"=>"IN", "types"=>["country", "political"]}],
"adr_address"=>"<span class=\"locality\">Bhiwadi</span>, <span class=\"region\">Rajasthan</span>, <span class=\"country-name\">India</span>",
"formatted_address"=>"Bhiwadi, Rajasthan, India",
"geometry"=>{"location"=>{"lat"=>28.2088218, "lng"=>76.84459989999999}, "viewport"=>{"northeast"=>{"lat"=>28.2216102, "lng"=>76.8750393}, "southwest"=>{"lat"=>28.1857546, "lng"=>76.8047977}}},
View text_search_gmap.json
{"html_attributions"=>[],
"results"=>
[{"formatted_address"=>"Rajasthan, India",
"geometry"=>{"location"=>{"lat"=>28.2088218, "lng"=>76.84459989999999}, "viewport"=>{"northeast"=>{"lat"=>28.2216102, "lng"=>76.8750393}, "southwest"=>{"lat"=>28.1857546, "lng"=>76.8047977}}},
"icon"=>"https://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png",
"id"=>"916e016e9ab610b45ac669464a43e6d39e30f2dd",
"name"=>"Bhiwadi",
"photos"=>
[{"height"=>3120,
"html_attributions"=>["<a href=\"https://maps.google.com/maps/contrib/109967878128997250391/photos\">Davinder kumar</a>"],
View 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')
@abdul-shajin
abdul-shajin / params.txt
Last active Dec 18, 2015
Rank Links according to number of parameters
View params.txt
Upvote number
Comments recieved for a link
Share count
user rank
Recency
Follower count of category (eg: gaming)
Visiter - Upvote ratio (later)
View gist:5662086
a)
1.upto(n).each do |num|
if num % 3 == 0
puts 'Hip'
next
elsif num % 5 == 0
puts 'Hop'
next
elsif (num % 3 == 0) && ( num % 5 == 0)
puts 'Whazaa'
View gist:5520052
[aji](https://www.codesavvy.com)
<a href='google.com'>Here</a>
View spree_help
Hi cmar,
I've stuck with an empty cart bug while developing a spree based application.seems like the reason behind the bug is a method which written by you.The details are here -> https://github.com/spree/spree/issues/2966 . Can you have a look and reply the intension for the method?? I am not able to track.
Thanks in advance
Abdul Shajin
View gist:5255275

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@abdul-shajin
abdul-shajin / jqueeery
Created Jan 28, 2012
stackoverflow_jquery
View jqueeery
$(".stream-cell").click(function(e) {
$(this).parent().find(".stream-cell").children(".more_content").slideDown("slow");
$(this).parent().find(".stream-cell").addClass("open_content");
});
I want to check e is coming from <a> tag or <div>
If e is from anchor tag, I want to call some ajax requests, or else, I want to call the existing lines.
You can’t perform that action at this time.