Skip to content

Instantly share code, notes, and snippets.

View practicingruby's full-sized avatar

Gregory Brown practicingruby

View GitHub Profile

TODO: Rewrite intended changes as before/after (maybe even using a diff or table view)

Intended changes:

  1. Unify URL scheme between "share links" and "internal links"
  2. Dynamically determine whether to use shared view or internal view depending on whether the visitor is logged in.
  3. Make URLs less opaque through the use of slugs
  4. Do all of this without breaking old links and behaviors
One-way analysis of means (not assuming equal variances)
data: rating and weekdaynum
F = 3.9332, num df = 6.0, denom df = 215.2, p-value = 0.0009428
Pairwise comparisons using t tests with pooled SD
data: data$rating and data$weekdaynum
I am starting the very early phases of writing a book
about the human side of software development. It'll cover
things like:
* Usability
* Maintainability
* Writing understandable code + building understandable products
* Team dynamics
* Technical writing and communication
* Measuring and assessing productivity

When a user signs up successfully, they will be sent to the dashboard. We will send them an email confirming the sign up.

test "A successful signup" do
  simulated_user.visit do
    sign_up(email: "guybush@threepwood.com",
            name:  "Guybush Threepwood",
            password: "ilikerootbeer")

 current_page.is("/dashboard")

Signup

  • Users need to sign up to use our app because [purpose]. We don't want to scare users with a long form though, so we'll simply ask for the minimum information. In our case that's the name, email and a password.

  • We don't ask users to confirm the password because they can easily reset it using the Forgot Password? link.

  • All fields are required, so the user will not be signed up if they fail to provide any of the required information.

  • Emails are unique, so using an email that already exists also results in an error.

Terrarium::Scenario.define do
  # create the forest
  patches do
    with_probability(0.4) { set_color :green }
  end

  # establish fire spreading behavior
  patches! do
 if color == :green && neighbors.any? { |e| e.color == :red }

If you had to guess based on intuition only (i.e. less than a minute or so of thinking time), what would you say is happening here?

require_relative "../lib/terrarium"
sim     = Terrarium::Simulator.new
display = Terrarium::Visualization.new

sim.notify(display)



grass = sim.patches! { set_patch_color(:green) if rand(1..500) == 1 }
An ecosystem with ten members each of ten unique species(***) play a simple game...
On each round, each creature rolls a 100 sided dice:
- If it rolls a 1, it dies.
- If it rolls a 2, it creates an exact clone of itself which joins
the game on the next round
- Otherwise, nothing happens and the creature simply moves on to the next round
Then all the creatures repeat the process again, and again, and again.
class BufferedHash
def initialize(head={})
@head = head
@buffer = {}
end
attr_reader :head
def [](key)
@buffer[key] || @head[key]