Skip to content

Instantly share code, notes, and snippets.


David Demonchy fusco

Block or report user

Report or block fusco

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
niinyarko / create_spec.rb
Last active Dec 16, 2018
Request Spec Example for Devise Token Auth Gem with Rails 5.1
View create_spec.rb
# Example Request
# My Devise model is named Merchant
# Key lines to note are 16, 21, 27, 28, 29
require 'rails_helper'
RSpec.describe 'POST /api/v2/customer_groups', type: :request do
let(:merchant) { FactoryGirl.create(:merchant) }
let(:user) { FactoryGirl.create(:user) }
let(:customer) { merchant.customers.create(user_id:}
let(:params) {{
tristanm /
Last active Oct 1, 2019
Migrating a Rails project from MySQL to PostgreSQL

Migrating a Rails project from MySQL to PostgreSQL

This brief guide is written from my own experience with migrating a large (~5GB) MySQL database to PostgreSQL for a Rails project.

No warranties, guarantees, support etc. Use at your own risk and, as always, ENSURE YOU MAKE BACKUPS FIRST!

I chose [pgloader][1] because it's extremely fast. YMMV.

  1. Replace mysql2 gem with pg in Gemfile.
  2. Update config/database.yml for PostgreSQL. I used [Rails' template][2] as a starting point.
tobi-pb /
Last active Dec 4, 2017
Upgrade MAMP to Mysql 5.6
tar xfvz mysql-5.6*
echo "stopping mamp"
sudo /Applications/MAMP/bin/
sudo killall httpd mysqld
echo "creating backup"
Bounga / routes.rb
Created Apr 23, 2013
Handle authenticated / unauthenticated root_path with devise
View routes.rb
authenticated :user do
root to: "agendas#show"
unauthenticated :user do
devise_scope :user do
root to: "devise/sessions#new"
joost /
Last active Jan 30, 2019
Google Analytics API (server-to-server) using Ruby
devdave / test3.rb
Created Jul 23, 2012
Working SA auth for Google analytics
View test3.rb
require 'pry'
require 'rubygems'
require 'google/api_client'
passPhrase = "notasecret"
keyFile = "YOUR KEY HERE-privatekey.p12"
scope = ''
email = ''
You can’t perform that action at this time.