Skip to content

Instantly share code, notes, and snippets.

View victorhazbunanuff's full-sized avatar

victor hazbun anuff victorhazbunanuff

  • koombea
  • barranquilla
View GitHub Profile
...
# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
config.authentication_keys = [ :login ]
# before filter for api controller
def verify_authenticity_token
@current_user = User.find_by_authentication_token(params[:auth_token])
render status: 401, json: { message: '...' } and return unless @current_user
end
require_relative '../../app/services/recurly_account_checker'
require 'recurly'
describe RecurlyAccountChecker do
let(:user) { stub }
let(:customer) { stub }
let(:customer_id) { -1 }
before do
user.stub(:customer_id) { customer_id }
Recurly::Account.stub(:find) { customer }
end
@victorhazbunanuff
victorhazbunanuff / gist:3991453
Created November 1, 2012 03:26 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@victorhazbunanuff
victorhazbunanuff / peepcode.rb
Created July 11, 2012 03:16 — forked from gertig/peepcode.rb
A script to download all Peepcode screencasts with ruby & wget (supports resume)
require 'mechanize'
@username = 'user@domain.com'
@password = 'hi2u'
@download_path = File.expand_path 'downloads'
@wget_cookie = File.expand_path(File.dirname(__FILE__)) + '/wget-cookies.txt'
unless File.directory? @download_path
puts "@{download_path} doesn't exist!"
exit
@victorhazbunanuff
victorhazbunanuff / das_download.rb
Created June 6, 2012 19:34 — forked from kalbasit/das_download.rb
Script to download all Destroy All Software screencasts, account needed
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password [download_directory]
require 'mechanize'
# gem 'mechanize-progressbar'
email = ARGV[0] or raise('Please provide the email address for your account')
password = ARGV[1] or raise('Please provide the password for your account')
path = (ARGV[2] || './').gsub /\//,''