Skip to content

Instantly share code, notes, and snippets.

💭
Coding

Jose Cortinas jacortinas

💭
Coding
Block or report user

Report or block jacortinas

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
View keybase.md

Keybase proof

I hereby claim:

  • I am jacortinas on github.
  • I am jacortinas (https://keybase.io/jacortinas) on keybase.
  • I have a public key ASAJ3peUnQ7WlOpCTUJslbbpmKQky-j9NQCyrbFu_N5nNwo

To claim this, I am signing this object:

View application.js
$(function() {
$(document).foundation('joyride', {
cookieMonster: true,
cookieName: 'tour',
cookieExpires: 365 * 5,
postRideCallback: function() {
alert('yeah');
console.log(arguments);
}
});
View user.rb
class User
def follow_default_users
default_user_emails = ['vulume@vulume.com']
default_user_emails.each do |email|
follow_with_email!(email)
end
end
def follow_with_email!(email)
View name.rb
class Name
def initialize name=''
@name = name
end
def name
@name ||= @name.to_s
end
alias :full :name
View invitation.rb
class InvitationRequest
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
include ActiveModel::Serializers::JSON
attr_reader :email, :url
attr_writer :clock, :invitation_class, :mailer
validates :email, presence: true
@jacortinas
jacortinas / authentication.rb
Created Jul 13, 2012
The difference between testing a small authentication file with BCrypt cost set to normal, then set to min.
View authentication.rb
# app/models/user/authentication.rb
require 'bcrypt'
class User
# Password authentication related methods and utilities.
module Authentication
extend ActiveSupport::Concern
module ClassMethods
@jacortinas
jacortinas / gist:3079083
Created Jul 9, 2012
Psych error using rbenv, ruby 1.9.3-p194 and rails 3.2.6
View gist:3079083
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant ANY
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant UTF8
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant UTF16LE
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin11.4.0/psych.bundle: warning: already initialized constant UTF16BE
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb:12: warning: already initialized constant ANY
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb:15: warning: already initialized constant UTF8
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb:18: warning: already initialized constant UTF16LE
/Users/jacortinas/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych/nodes/stream.rb:
View gist:1143425
redis_instance.pipelined do
[1,2,3].each do |item|
redis_instance.sadd 'some_key', item
end
end
View spec_helper.rb
require 'rubygems'
require 'spork'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
@jacortinas
jacortinas / Gemfile
Created Jul 19, 2011
This used to be much more complicated, but nothing felt as solid as this core setup.
View Gemfile
...
group :development, :test do
gem 'rspec-rails'
gem 'capybara'
gem 'spork', '~> 0.9.0.rc'
...
gem 'rb-fsevent' # recommended for non-polling filesystem event notifications
gem 'growl'
gem 'guard'
You can’t perform that action at this time.