If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is example how to rescue from exception ActionDispatch::Http::MimeNegotiation::InvalidType | |
# and show nice JSON error in your API | |
module API | |
class BaseController < ActionController::API | |
def process_action(*args) | |
super | |
rescue ActionDispatch::Http::MimeNegotiation::InvalidType => exception | |
# set valid Content-Type to be able to call render method below | |
request.headers['Content-Type'] = 'application/json' | |
render status: 400, json: { errors: [exception.message] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom text filters | |
module TextFilter | |
# USD Currency | |
def currency(input) | |
return sprintf('$%0.2f',input).gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,") | |
end | |
end | |
# Globally register custom text filters | |
Liquid::Template.register_filter(TextFilter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
describe "GET #index" do | |
#describe "POST #create" do | |
#describe "GET #show" do | |
#describe "PATCH #update" do (or PUT #update) | |
#describe "DELETE #destroy" do | |
#describe "GET #new" do |
http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails.env.production? | |
PAYPAL_ACCOUNT = 'production@gmail.com' | |
else | |
PAYPAL_ACCOUNT = 'development@gmail.com' | |
ActiveMerchant::Billing::Base.mode = :test | |
end |
NewerOlder