Skip to content

Instantly share code, notes, and snippets.

View jagdeepsingh's full-sized avatar

Jagdeep Singh jagdeepsingh

  • Mohali
View GitHub Profile

Binary

A binary is a bitstring where number of bits is divisible by 8.

> binary = <<0, 1, 2>>
> byte_size binary
3

> String.valid? binary
@jagdeepsingh
jagdeepsingh / README.md
Last active September 24, 2019 08:46
Red Dot Payment - Integration with Rails
@jagdeepsingh
jagdeepsingh / README.md
Last active April 19, 2019 09:47
Swagger
@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
Last active October 23, 2018 06:17
HTTP requests using Net::HTTP

HTTP Requests

require 'net/http'
require 'uri'

Parse URL.

@jagdeepsingh
jagdeepsingh / README.md
Last active June 7, 2018 06:54
rubocop