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
  • Run Rubocop for only the files that have changed on the current branch:
alias cop='rubocop `git diff --name-only master..HEAD`'
@rakibulislam
rakibulislam / genymotionwithplay.txt
Created March 14, 2017 02:58 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
ExampleModule.methods(false)
#=> [:module_method]
ExampleModule.singleton_class.instance_methods(false)
#=> [:module_method]
ExampleModule.instance_methods(false)
#=> [:normal_method]
require "uri"
require "net/http"
require "json"
uri = URI.parse("https://api.branch.io/v1/url")
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

@rakibulislam
rakibulislam / gist:11e992c8231e3f3f52bced18bc247e20
Created December 24, 2016 21:04 — forked from spraints/gist:1648617
setting up a subscription with stripe

Subscriptions with stripe

Code examples use the stripe ruby gem. Most of the links are to stripe's documentation.

![stripe's object model][stripe_object_model_diagram]

Initial setup

To start, create some plans.

@rakibulislam
rakibulislam / integration_spec.rb
Created December 17, 2016 05:12 — forked from austenito/integration_spec.rb
Integration Testing w/ Sorcery
describe "Shopping Cart Requests" do
let!(:user) { Fabricate(:user) }
before(:each) do
login_user_post("admin", "admin")
end
context "when I visit the shopping cart" do
it " show the logged in users' cart items " do
#Test stuff
# https://github.com/plataformatec/faraday-http-cache
client = Faraday.new do |builder|
builder.use :http_cache, store: Rails.cache, logger: Rails.logger
builder.adapter Faraday.default_adapter
end
response = client.get("#{Settings[:api_server]}/#{resource}",
{ start_date_key => range_parameter },
{ 'Accept' => 'application/json' }
@rakibulislam
rakibulislam / server.md
Created July 17, 2016 07:00 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@rakibulislam
rakibulislam / capybara cheat sheet
Created July 14, 2016 14:44 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=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')