Skip to content

Instantly share code, notes, and snippets.

Jason Rush diminish7

Block or report user

Report or block diminish7

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 diminish7 on github.
  • I am diminish7 (https://keybase.io/diminish7) on keybase.
  • I have a public key whose fingerprint is E1AF 2FE0 04F9 4968 02D7 7C53 C8A8 DB5E C50A F9B8

To claim this, I am signing this object:

@diminish7
diminish7 / gist:8947190
Created Feb 12, 2014
NMatrix Compilation Output
View gist:8947190
deploy@web:~/nmatrix$ bundle exec rake compile
Your Gemfile lists the gem pry (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Your Gemfile lists the gem rspec-longrun (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
mkdir -p tmp/x86_64-linux/nmatrix/2.1.0
cd tmp/x86_64-linux/nmatrix/2.1.0
/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby -I. ../../../../ext/nmatrix/extconf.rb
View authentication_tokens_controller.rb
class AuthenticationTokensController < BaseApiController
skip_before_filter :authenticate_user!, only: :create
def create
resource = User.find_for_database_authentication(login: params[:login])
if resource && resource.valid_password?(params[:password])
resource.reset_authentication_token
resource.save(validate: false)
render :json => successful_json_with_user_information(resource)
@diminish7
diminish7 / build_association.rb
Created Apr 18, 2012
Proposed change to build_association
View build_association.rb
# Returns a new, unsaved instance of the associated class. +options+ will
# be passed to the class's constructor.
def build_association(*options, &block)
if options.first.is_a?(Hash) && (subclass_name = options.first.with_indifferent_access[klass.inheritance_column]).present?
begin
subclass = klass.module_eval { compute_type(subclass_name) }
raise NameError unless (subclass == klass || subclass.ancestors.include?(klass))
subclass.new(*options, &block)
rescue NameError
raise ActiveRecord::SubclassNotFound.new("Invalid single-table inheritance type: #{subclass_name} is not a subclass of #{klass.name}")
You can’t perform that action at this time.