Skip to content

Instantly share code, notes, and snippets.

Avatar

Jagdeep Singh jagdeepsingh

  • New Delhi
View GitHub Profile
@jagdeepsingh
jagdeepsingh / GMO_PAYMENTS_ON_RAILS.md
Last active May 21, 2021
GMO Payment Gateway integration with Rails including Credit Card tokenization and setting up Managed Accounts through API
@jagdeepsingh
jagdeepsingh / README.md
Created May 3, 2021
Setup new Rails 6.x application using Mongoid 7.x
View README.md
@jagdeepsingh
jagdeepsingh / SETUP.md
Last active Sep 22, 2021
Set up macOS Big Sur 11.2 with development tools | Git | Homebrew | rbenv | ruby | Atom | PostgreSQL | mongodb
View SETUP.md
@jagdeepsingh
jagdeepsingh / README.md
Created May 21, 2020
Selenium Webdriver with Ruby
View README.md

Selenium Webdriver

1. Config

  • Ruby v2.5.1
  • macOS Catalina 10.15

2. Install gems

2.1 selenium-webdriver

@jagdeepsingh
jagdeepsingh / README.md
Last active Jan 10, 2021
Set up macOS Catalina 10.15 with development tools | Git | Homebrew | rbenv | bundler | Atom | Databases | Node.js | Yarn | kubectl | Elastic Stack
View README.md
@jagdeepsingh
jagdeepsingh / README.md
Last active Sep 24, 2019
Red Dot Payment - Integration with Rails
View README.md
@jagdeepsingh
jagdeepsingh / README.md
Last active Oct 23, 2018
Net::HTTP - An HTTP Client API for Ruby
View README.md

Net::HTTP

1 Request

1.1 GET

Prepare params

If there are any params with an Array value, you need to pass them as { 'foo[]' => [1, 2, 3] }. Below logic does that conversion for you.

@jagdeepsingh
jagdeepsingh / README.md
Created Feb 6, 2018
jQuery - Go to an element on page
View README.md

Go to an element on page using jQuery.

// @params
//   ms - milliseconds
//   top - padding from top after scrolling to the element
(function(jQuery) {
  jQuery.fn.goTo = function(ms, top) {
    if (top == null) {
      top = 10;
@jagdeepsingh
jagdeepsingh / README.md
Created Feb 6, 2018
JavaScript, jQuery - Check element position with respect to Viewport
View README.md
// @params
//   element - Element whose position is to be found
//   footerHeight - Height to subtract from window bottom in case of a fixed footer/overlay
window.elementPositionByViewport = function(element, footerHeight) {
  var elementBottom, elementTop, screenBottom, screenTop;

  if (footerHeight == null) {
    footerHeight = 0;
  }