- Use Control+W instead of Alt+Backspace
- To unindent a line, use Ctrl+D
- To indent a line, use Ctrl+T
- Upper-case J joins lines (same as Cmd+J in Sublime Text)
- Use :edit! to force a reload of the current file from disk.
- To skip to the first non-whitespace character on a line, press ^
- yy copies (yanks) a line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Article < ActiveRecord::Base | |
attr_accessible :title, :body, :tag_list, :image | |
has_many :comments | |
has_many :taggings | |
has_many :tags, :through => :taggings | |
has_attached_file :image | |
def tag_list | |
return self.tags.join(", ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start a new Rails App from scratch that allows users to store an awesome list of their favorite music and movies and books. | |
Each user will have their own Awesome List to organize and display favorites. | |
You may set up the models and relationships however you like. Here are some ideas on what to feature for each category: | |
Movies - Title, Image, Year, Genre, Actors, Comments, etc ... | |
Music - Artist, Image, Album, Genre, Favorite song, Comments, etc ... | |
Books - Title, Image, Author, Description, Comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for @customer, :html => {:multipart => true} do |f| %> | |
<%= f.hidden_field :id %> | |
<p> | |
<%= f.file_field :image %> | |
</p> | |
<p><%= f.submit "Upload" %></p> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-if @customer.notes.present? | |
-@customer.notes.each do |customer| | |
=customer.title | |
=customer.comment | |
-#Keep in mind this would be for haml so for erb you need to modify with <% %>, etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Customer < ActiveRecord::Base | |
belongs_to :user | |
has_many :notes | |
attr_accessible :address_city, :address_state, :address_state, :address_street, :email, :id, :name_company, :name_first, :name_last, :phone, :postal_code, :image | |
mount_uploader :image, ImageUploader | |
attr_accessible :image | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% if @customer.notes.present? %> | |
<% @customer.notes.each do |customer| %> | |
<% =customer.title %> | |
<% =customer.comment %> | |
<% end %> | |
<% end %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddTitleToPosts < ActiveRecord::Migration | |
def change | |
add_column :posts, :title, :string | |
add_column :posts, :image, :string | |
add_column :posts, :link, :string | |
add_column :posts, :documentation, :text | |
end | |
#NOTE: there's another way to write ^ a little more streamlined | |
#For now do this for clarity | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
- Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
OlderNewer