Skip to content

Instantly share code, notes, and snippets.

View practicingruby's full-sized avatar

Gregory Brown practicingruby

View GitHub Profile
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 }

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?

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 }

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.

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

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
module Vintage
class Processor
OPCODES = { 0xa9 => :LDA, 0x8D => :STA }
def initialize
@acc = 0
@memory = {}
end
attr_reader :acc, :memory
# NOTE: Maybe have a factory to split objects between "Immediate" mode and
# everything else
class Cell
def initialize(processor, mode)
@processor = processor
@mode = mode
compute_address
end