Skip to content

Instantly share code, notes, and snippets.

View abdul-shajin's full-sized avatar

Abdul Shajin abdul-shajin

  • E2Open
  • Bangalore
View GitHub Profile
@abdul-shajin
abdul-shajin / jqueeery
Created January 28, 2012 12:05
stackoverflow_jquery
$(".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.

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
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
[aji](https://www.codesavvy.com)
<a href='google.com'>Here</a>
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'
@abdul-shajin
abdul-shajin / params.txt
Last active December 18, 2015 08:29
Rank Links according to number of parameters
Upvote number
Comments recieved for a link
Share count
user rank
Recency
Follower count of category (eg: gaming)
Visiter - Upvote ratio (later)
=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 / text_search_gmap.json
Created February 27, 2018 08:04
google map text search
{"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>"],
{"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}}},
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/.......