Skip to content

Instantly share code, notes, and snippets.

@kjs222
kjs222 / rails_setup.md
Created December 2, 2016 22:27 — forked from ryanflach/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)

#Make a heat map graphic with D3.js

This gist contains the code to create a simple "heat map" with D3.js. In this case, the "heat map" is a graph showing activity distributed over the days of the week on one axis and the weeks of the year on the other.

This gist is meant to be used as part of a workshop where the code is uncommented as the workshop progresses.

It could also be used as a puzzle outside of a workshop: follow the clues to reconstruct the correct code and make it work!

In the end, the chart should look something like this:

Deliverable

  • Read [Node.js, Require and Exports][rblog] and [Organize Your Code with RequireJS][rblog2]
  • Fork This Gist
  • Respond in your forked gist with answers to the following questions

In the context of Node, what is a module?

##Hello World My code: here

  • Responder #1 (here) - This person took the same approach but did not use the ternary operator. She used a single if statements to handle the situation where input was provided. There are two return statements - one on the if and one without a condition.

  • Responder #2 (here) - This person used a memoization type technique to handle whether input was provided or not. This is a valid approach, but is less intuitive (imo) than using a conditional.

  • Responder #3 (here) - I like the classical use of the if/else in this response. I think it's the most intuitive. I think the use of .length on the input is superfluous.

  • Responder #4 (here) - t

Length Points Week
15 minutes 5 Week 1

ES6 Research

Throughout the module (and your journey to Google enlightenment while working on IdeaBox2.0) you may notice a few different ways that JavaScript code is being written.

That might have something to do with something called ES6 and ES5

@kjs222
kjs222 / crud.md
Last active May 10, 2016 18:25 — forked from Carmer/crud.markdown
  1. Define CRUD.
  2. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
  3. Why do we use set method_override: true?
  4. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>.
  5. What are params? Where do they come from?
  • What do you know about modules already? If little, what would you guess modules are all about?
  • Golf and basketball both use a ball. But if you're on a basketball court and ask for "the ball," no one is going to throw you a golf ball. Why? If you were as dumb as a computer, why would a golfd ball be an acceptable response?
  • You've learned about the object model and method lookups. What would the imapct be of injecting an additional ancestor into a class' lookup chain?
@kjs222
kjs222 / Kerry_prework.md
Last active March 15, 2016 03:50 — forked from mbburch/prework.md
An example template for your Turing pre-work Gist

Turing School Prework - Kerry Sheldon

Task A- Practice Typing:

  • screenshots of scores posted in comments

Task B- Algorithmic Thinking & Logic:

  • screenshots of completed sections posted in comments

Task C- Create your Gist: this is it!