Skip to content

Instantly share code, notes, and snippets.

View ajwinn's full-sized avatar

Adam Winn ajwinn

  • @zerply
  • San Francisco, CA
View GitHub Profile
@ajwinn
ajwinn / dabblet.css
Created October 25, 2013 07:48
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: white;
background: white;
min-height: 100%;
#ServerOn8888 Directory Listing
index.html
jquery-1.7.2.js
ServerOn8888.js
= form_for @post do |f|
- if @post.errors.any?
#error_explanation
%h2= "#{pluralize(@post.errors.count, "error")} prohibited this post from being saved:"
%ul
- @post.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :name
@ajwinn
ajwinn / movies_controller_spec.rb
Created November 14, 2012 02:37
Result of running Rspec
administrator$ rspec spec/controllers/movies_controller_spec.rb
.**
Pending:
MoviesController searching TMDb should select the Search Results template for rendering
# Not yet implemented
# ./spec/controllers/movies_controller_spec.rb:10
MoviesController searching TMDb should make the TMDb search results available to that template
# Not yet implemented
# ./spec/controllers/movies_controller_spec.rb:11
@ajwinn
ajwinn / From Terminal
Created November 13, 2012 17:40
spec/controllers/movies_controller_spec.rb
Admins-MacBook-Air-2:spec administrator$ rspec /Users/administrator/Dropbox/projects/edX/nabin/spec/movies_controller_spec.rb
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called.
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile
/Users/administrator/Dropbox/projects/edX/nabin/spec/movies_controller_spec.rb:8:in `block (2 levels) in <top (required)>': undefined method `post' for #<Class:0x007fd07dfc71c8> (NoMethodError)
from /Users/administrator/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:201:in `module_eval'
from /Users/administrator/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:201:in `subclass'
from /Users/administrator/.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:187:in `describe'
from /Users/administrator/Dropbox/projects/edX/nabin/spec/movies_controller_spec.rb:5:in `block in <top (required)>'
fro
Given /the following movies exist/ do |movies_table|
movies_table.hashes.each do |movie|
Movie.create!(movie)
# each returned element will be a hash whose key is the table header.
# you should arrange to add that movie to the database here.
end
# flunk "Unimplemented"
assert(Movie.all.length == movies_table.hashes.length)
end
@ajwinn
ajwinn / gist:3989011
Created October 31, 2012 18:43
Does Ruby understand tables?
# from the .feature
Given the following movies exist:
| title | rating | release_date |
| Aladdin | G | 25-Nov-1992 |
| The Terminator | R | 26-Oct-1984 |
# from the _steps.rb
Given /the following movies exist/ do |movies_table|
movies_table.hashes.each do |movie|
@ajwinn
ajwinn / ThreeActStructure
Created January 5, 2012 20:37
The Three Act Structure in Film
My sole claim to fame is having written a screenplay in college that won the 2004 David Letterman Competition - a feat that required rigorous study of Syd Field's Three Act Structure. The subject matter obviously varies, but in brief, the first act is approximately 30 minutes long, the second act is 60 minutes, and the final act is 20 to 30 minutes. The first act's responsibility is to introduce us to all the characters, their flaws/goals, and the conflict event that drives the protagonist into the second act. In the second act, the protagonist faces increasingly difficult situations that drive him toward overcoming his flaws and resolving the conflict event. The third act observes a capable protagonist making a final decision that addresses his flaws and the primary conflict.
The structure itself is essentially "beginning, middle, and end" with some advice about when to deal with conflict. Some writers prefer Joseph Campbell's "Monomyth" or "Hero's Journey" structure (famously used in Star Wars), which i