Skip to content

Instantly share code, notes, and snippets.

@hosh
Created April 20, 2010 14:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hosh/372564 to your computer and use it in GitHub Desktop.
Save hosh/372564 to your computer and use it in GitHub Desktop.
Sample Remarkable Macros
# In app/models/person.rb
class Person < ActiveRecord::Base
belongs_to :organization
validates_presence_of :name
validates_presence of :email
validates_uniqueness_of :email
end
# In spec/models/person_spec.rb
describe Person do
before(:each) do
@valid_attributes = {
:name => "Name"
:email => "email@example.com"
}
end
it "should create a new instance given valid attributes" do
Person.create!(@valid_attributes)
end
it "should validate presence of :name" do
@person = Person.new(@valid_attributes.except(:name)
@person.should_not be_valid
@person.errors.on(:name).should_not be_nil
end
it "should validate presence of :email" do
@person = Person.new(@valid_attributes.except(:email)
@person.should_not be_valid
@person.errors.on(:email).should_not be_nil
end
it "should validate uniqueness of :email" do
@original_person = Person.create!(@valid_attributes)
@clone = Person.create!(@valid_attributes)
@person.should_not be_valid
@person.errors.on(:email).should_not be_nil
end
end
@QueensDeeJay
Copy link

Pardon the Q, but as a non-coder (but very willing to learn at 76), how would I get this code into my reMarkable.

Better yet, how could I create macros for my own use on my RM2? This is an honest question. I hope you will accept it as such.

Thanks for anything you're willing to share,
DeeJay

@hosh
Copy link
Author

hosh commented May 20, 2023

@QueensDeeJay Are you perhaps talking about the reMarkable eink tablet?

This just is for a Ruby on Rails library called Remarkable, used to test backend code, and doesn't have anything to do with the eink tablet.

reMarkable runs on top of Linux. You can add macros into the device itself, but it is difficult. There are some other options with syncing documents to your desktop and adding macros to process those documents on your desktop. Either way, if you want to learn more technical things as a non-technical person, working with the chat AIs can help -- ChatGPT, Google Bard, or Phind.com

https://www.phind.com/search?q=How%20can%20I%20add%20macros%20to%20the%20remarkable%20eink%20tablet%3F&source=searchbox

You can probably ask your question directly on the reMarkable support https://support.remarkable.com/s/

@QueensDeeJay
Copy link

QueensDeeJay commented May 21, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment