Skip to content

Instantly share code, notes, and snippets.

View jschoolcraft's full-sized avatar

Jeff Schoolcraft jschoolcraft

View GitHub Profile
@jschoolcraft
jschoolcraft / persistence.md
Created May 18, 2011 23:28 — forked from jraines/persistence.md
Notes on Adam Keys' presentation "Mixing a persistence cocktail"
  • Marshaling AR objects: dangerous if internal structure of AR object changes with Rails change

Relaxing consistency requirements

  • Is it ok for users to see slightly older data?

Configuring

  • Initializer that loads yaml file that loads different connections per Rails environtment
@jschoolcraft
jschoolcraft / confident-code.md
Created May 18, 2011 23:28 — forked from jraines/confident-code.md
Notes on Avdi Grimm's "Confident Code"

Confident Code

timid code

  • Randomly mixes input gathering, error handling, and business logic
  • imposes cognitive load on the reader

confident code

  • no digressions
@jschoolcraft
jschoolcraft / deployment.md
Created May 18, 2011 23:28 — forked from jraines/deployment.md
21 Deployment Tips in 50 minutes

Vagrant

gem install vagrant

vagrant up

vagrant halt

  • Ruby DSL for provisioning VirtualBox VMs
  • creates a user named vagrant, with password 'vagrant'
@jschoolcraft
jschoolcraft / SASS-notes.md
Created May 18, 2011 23:28 — forked from jraines/SASS-notes.md
Notes on SASS presentation - RailsConf 2011

Use this format to assign variables:

$error-red: #911

Transformations:

background-color: lighten(red, 10%)

Functions:

@jschoolcraft
jschoolcraft / searchbox.md
Created May 18, 2011 23:28 — forked from jraines/searchbox.md
Notes on "Enhanching the Search Box" - RailsConf 2011

###Autocomplete

  • the big lebowski
  • Prefix search
  • rails-3-jquery-autocomplete Gem
    • rails g autocomplete
    • javascript_include_tag "autocomplete-rails.js"
    • autocomplete :resource, :title #, :full => true
    • autocomplete_field_tag
  • Not really flexible over multiple models
@jschoolcraft
jschoolcraft / eventmachine.md
Created May 18, 2011 23:28 — forked from jraines/eventmachine.md
EventMachine Railsconf notes

Implementation of the Reactor pattern

  • Most web apps are I/O bound, not CPU bound
  • Instead of waiting on a response from the network, use that time to process other requests
  • Handle 5-10k concurrent connections with a single Ruby process
EM.run do 
  EM.start_server '0.0.0.0', 2202, EchoServer
end
@jschoolcraft
jschoolcraft / bundler-deploy.md
Created May 18, 2011 23:27 — forked from jraines/bundler-deploy.md
Deploying with bundler - RailsConf 11 notes

####Scope your gems to your app:

bundle install --path vendor/bundle

####Ensure that bundle install has been run locally

(ie, there are no gems in Gemfile that do not match the lockfile

bundle install --frozen

@jschoolcraft
jschoolcraft / worker-pattern.md
Created May 18, 2011 23:27 — forked from jraines/worker-pattern.md
Horizontal scaling with the Worker pattern

Note - reference these slides; good diagrams

##High traffic

Problem: Heavy lifting inside the request cycle

  • Bound by slowest API
  • Potential redundant retrieval (popular search term)

The Worker Pattern decouples web request from services required to respond to request

Rails 3 Design Choices - Jose Valim

SOLID Design Principles

Agile Software Development - Bob Martin Book is based on developing in Java/C… some interpretation for ruby.

Single Responsibility Open Closed - open for extension … closed for modification Liskov Substition

@jschoolcraft
jschoolcraft / gist:979793
Created May 18, 2011 23:12 — forked from Gregg/gist:968534
Code School Screencasting Framework

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 screencast 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 then a phone call or screen sharing.