Skip to content

Instantly share code, notes, and snippets.

@beverlynelson
beverlynelson / Gemfile
Created March 10, 2016 01:53 — forked from grantspeelman/Gemfile
Example Gemfile files preparing for the next rails upgrade
@next_upgrade ||= false
source 'https://rubygems.org'
if @next_upgrade
gem 'rails', '5.0.0.beta3'
gem 'rails-controller-testing' # https://github.com/rails/rails-controller-testing
else
gem 'rails', '~> 4.2.5.1'
end

Screencasting Framework

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.

Why you should care about screencasting?

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.

  1. 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.
" 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)

Sublime to Vim

  • 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

Window Commands

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
@beverlynelson
beverlynelson / gist:4146698
Created November 26, 2012 05:09
erb version
<% if @customer.notes.present? %>
<% @customer.notes.each do |customer| %>
<% =customer.title %>
<% =customer.comment %>
<% end %>
<% end %>
@beverlynelson
beverlynelson / gist:4146638
Created November 26, 2012 04:39
customer.rb
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
@beverlynelson
beverlynelson / gist:4115616
Created November 20, 2012 02:49
display customer information
-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.
@beverlynelson
beverlynelson / _form
Created November 13, 2012 03:30 — forked from denniskeefe/_form
CRM-Two Form
<%= form_for @customer, :html => {:multipart => true} do |f| %>
<%= f.hidden_field :id %>
<p>
<%= f.file_field :image %>
</p>
<p><%= f.submit "Upload" %></p>
<% end %>
@beverlynelson
beverlynelson / gist:3943239
Created October 24, 2012 01:45
The Awesome List Practice Challenge #1 - Ruby Friends
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