Skip to content

Instantly share code, notes, and snippets.

View rakibulislam's full-sized avatar
🎯
Focusing

K M Rakibul Islam (Rakib) rakibulislam

🎯
Focusing
View GitHub Profile
@rakibulislam
rakibulislam / index.md
Created September 11, 2018 15:54 — forked from bvaughn/index.md
How to use profiling in production mode for react-dom
@rakibulislam
rakibulislam / gist:6543c10736f5f2b93b255466f73b2734
Created August 24, 2018 21:50 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@rakibulislam
rakibulislam / RAILS_5_CHEATSHEET.md
Created August 17, 2018 18:08 — forked from harrietty/RAILS_5_CHEATSHEET.md
Ruby on Rails 5 Cheatsheet

Ruby on Rails Cheatsheet (5.1)

Architecture

RVM

$ rvm list - show currently installed Rubies

import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
import {AppProvider, Page, Card, Button} from '@shopify/polaris';
const Users = props => (
<AppProvider>
<Page title="Users">
{props.users.map((user, index) => (
<Card key={index}
@rakibulislam
rakibulislam / bootstrap-memo.md
Created July 27, 2018 11:27 — forked from yalab/bootstrap-memo.md
rails5 + webpacker + bootstrap
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add bootstrap@4.0.0-beta jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
@rakibulislam
rakibulislam / bench_rails_memory_usage.rb
Created June 19, 2018 16:41 — forked from brianhempel/bench_rails_memory_usage.rb
A script to test the memory usage of your Rails application over time. It will run 30 requests against the specified action and report the final RSS. Choose the URL to hit on line 45 and then run with `ruby bench_rails_memory_usage.rb`.
require "net/http"
def start_server
# Remove the X to enable the parameters for tuning.
# These are the default values as of Ruby 2.2.0.
@child = spawn(<<-EOC.split.join(" "))
XRUBY_GC_HEAP_FREE_SLOTS=4096
XRUBY_GC_HEAP_INIT_SLOTS=10000
XRUBY_GC_HEAP_GROWTH_FACTOR=1.8
XRUBY_GC_HEAP_GROWTH_MAX_SLOTS=0
@rakibulislam
rakibulislam / GraphQL-API-tutorial.md
Created June 15, 2018 04:30 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'`
CHECKSUM=$(echo -n "application/json,,/transactions/<ID>,$CURRENT_DATE" \
| openssl dgst -sha1 -binary -hmac "your-secret-key" \
| base64)
curl "https://apix.casiregalii.com/transactions/<ID>" \
-X GET \
-H "Accept: application/vnd.regalii.v3.2+json" \
-H "Content-Type: application/json" \
-H "Content-MD5:" \
CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'`
CHECKSUM=$(echo -n "application/json,,$CURRENT_DATE" \
| openssl dgst -sha1 -binary -hmac "your-secret-key" \
| base64)
curl "https://apix.casiregalii.com/rpps_billers" \
-X GET \
-H "Accept: application/vnd.regalii.v3.2+json" \
-H "Content-Type: application/json" \
-H "Content-MD5:" \
CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'`
CHECKSUM=$(echo -n "application/json,,/bills/<ID>/pay,$CURRENT_DATE" \
| openssl dgst -sha1 -binary -hmac "your-secret-key" \
| base64)
curl "https://apix.casiregalii.com/bills/<ID>/pay" \
-X POST \
-d '{"amount":5568.00, "currency":"USD"}' \
-H "Accept: application/vnd.regalii.v3.2+json" \
-H "Content-Type: application/json" \