Skip to content

Instantly share code, notes, and snippets.

Einar Jonsson einarj

Block or report user

Report or block einarj

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
@einarj
einarj / gist:f5fa070bf45fde0c57ef
Created May 26, 2014
Create a file with random data of specified size
View gist:f5fa070bf45fde0c57ef
dd if=/dev/urandom of=yourfile bs=1m count=2
@einarj
einarj / invitation.rb
Created Aug 22, 2012
validate_acceptance_of behaviour
View invitation.rb
class Invitation
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
attr_accessor :terms
validates_acceptance_of :terms, :on => :save, :allow_nil => false
def initialize(attrs={})
You can’t perform that action at this time.