Skip to content

Instantly share code, notes, and snippets.

View vicmaster's full-sized avatar

Victor Velazquez vicmaster

View GitHub Profile
module ActionController
class Base
def self.protect_from_forgery; end
def self.before_filter(args); end
def self.layout(args); end
end
end
RSpec.configure do |config|
config.mock_with :rr
@vicmaster
vicmaster / capybara_cheat_sheet.md
Created November 29, 2016 23:47 — forked from WaKeMaTTa/capybara_cheat_sheet.md
Capybara - Cheat Sheet

Navigating

visit("/projects")
visit(post_comments_path(post))

Clicking links and buttons

@vicmaster
vicmaster / rbenv-howto.md
Created August 1, 2017 17:51 — forked from MicahElliott/rbenv-howto.md
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

@vicmaster
vicmaster / home_spec.rb
Created January 11, 2018 07:43 — forked from agmcleod/home_spec.rb
shopify api integration testing
require 'spec_helper'
describe "home" do
before do
@domain = "myshop.myshopify.com"
@token = SecureRandom.hex(16)
@shopify_session = ShopifyAPI::Session.new(@domain, @token)
end
@vicmaster
vicmaster / Visible&HiddenTimeOnPage
Created January 22, 2018 18:46 — forked from RitwikGA/Visible&HiddenTimeOnPage
Time On Visible and Hidden Page
var prefix=function() {
var prefixes = ['moz', 'ms', 'o', 'webkit'];
if ('hidden' in document) {
return '';
}
// Loop through each prefix to see if it is supported.
for (var i = 0; i < prefixes.length; i++) {