Skip to content

Instantly share code, notes, and snippets.

View jagdeepsingh's full-sized avatar

Jagdeep Singh jagdeepsingh

  • Mohali
View GitHub Profile
@jagdeepsingh
jagdeepsingh / GMO_PAYMENTS_ON_RAILS.md
Last active June 20, 2022 08:43
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 18:45
Setup new Rails 6.x application using Mongoid 7.x
@jagdeepsingh
jagdeepsingh / SETUP.md
Last active September 22, 2021 15:28
Set up macOS Big Sur 11.2 with development tools | Git | Homebrew | rbenv | ruby | Atom | PostgreSQL | mongodb
@jagdeepsingh
jagdeepsingh / README.md
Created May 21, 2020 11:57
Selenium Webdriver with Ruby

Selenium Webdriver

1. Config

  • Ruby v2.5.1
  • macOS Catalina 10.15

2. Install gems

@jagdeepsingh
jagdeepsingh / README.md
Last active December 9, 2021 10:26
Set up macOS Catalina 10.15 with development tools | Git | Homebrew | rbenv | bundler | Atom | Databases | Node.js | Yarn | kubectl | Elastic Stack
@jagdeepsingh
jagdeepsingh / README.md
Last active September 24, 2019 08:46
Red Dot Payment - Integration with Rails
@jagdeepsingh
jagdeepsingh / README.md
Last active October 23, 2018 07:47
Net::HTTP - An HTTP Client API for Ruby

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 February 6, 2018 14:14
jQuery - Go to an element on page

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 February 6, 2018 14:09
JavaScript, jQuery - Check element position with respect to Viewport
// @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;
 }