Skip to content

Instantly share code, notes, and snippets.

Aboobacker MK redtachyons

Block or report user

Report or block redtachyons

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
redtachyons /
Last active Sep 22, 2018 — forked from alameenkhader/
Rpush/Rails Integration

rpush -

Follow the steps in rpush to add the gem to your rails project


rails g model PushNotificationDevice device_type:integer:index device_token:string
class CreatePushNotificationDevices < ActiveRecord::Migration
View setup
sudo -u postgres psql postgres
\password postgres
pg_hba.cong -> peer-> md5
redtachyons / SOLID.markdown
Created Dec 29, 2017 — forked from emaraschio/SOLID.markdown
SOLID Principles with ruby examples
View SOLID.markdown

#SOLID Principles with ruby examples

##SRP - Single responsibility principle A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

##OCP - Open/closed principle Software entities should be open for extension, but closed for modification.

redtachyons / vcr.rb
Created Sep 7, 2017 — forked from just3ws/vcr.rb
VCR configuration that does a pretty good job of filtering out GitHub, Twitter, and LinkedIn keys.
View vcr.rb
VCR.configure do |c|
c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
c.hook_into :webmock
c.ignore_localhost = true
c.default_cassette_options = { record: :new_episodes }
c.allow_http_connections_when_no_cassette = false
c.ignore_hosts ''
View prime.rb
require 'rspec'
require 'prime'
class SocChallenge
def initialize(number)
@number = number
View capybara cheat sheet
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')
redtachyons / ways_to_use_vcr.rb
Created Apr 25, 2017 — forked from myronmarston/ways_to_use_vcr.rb
Ways to use VCR for a request made by a let block
View ways_to_use_vcr.rb
# 1) Use VCR.use_cassette in your let block. This will use
# the cassette just for requests made by creating bar, not
# for anything else in your test.
let(:foo) { VCR.use_cassette("foo") { create(:bar) } }
it "uses foo" do
# 2) Wrap the it block that uses #foo in VCR.use_cassette.
View rspec_cheatsheet_controller_spec.rb
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
You can’t perform that action at this time.