Skip to content

Instantly share code, notes, and snippets.

@Reltre
Reltre / uftf-meeting-stm.markdown
Created August 28, 2018 03:45
Notes - UFTF - C5 - 27th Aug.

Valuation

  • Lack of valuation in trees throughout much of the public.
  • Value is based on canopy size. Check wood mass, and number of trees it takes to replace it.
  • Usually once a tree has 30 in. radius, it was usually worth around 100k DBH

Usually planted around 3” and up.

@Reltre
Reltre / organization.markdown
Last active May 8, 2018 03:07
Street Tree Map - Organization and Fields
@Reltre
Reltre / mocks-are-not-stubs.markdown
Last active April 3, 2023 15:41
Mocks Aren't Stubs - Notes

Notes for an article on testing and the various paradigms available to us

SEAT: Setup, Exercise, Assert, Teardown

Setup: Setup any objects necessary for tests to run.


Exercise: Make any calls for invoke specific behavior that is necessary for testing a feature or aspect of our program.

@Reltre
Reltre / currency_test.rb
Created April 6, 2016 18:42
To Currency Tests
require 'minitest/autorun'
require_relative 'currency'
class CurrencyTest < Minitest::Test
def test_invalid_currency
assert_raises(ArgumentError) { to_currency("453&$*#") }
end
def test_dollar_format
assert_equal '$', to_currency("5")[0]
@Reltre
Reltre / circular_buffer_procedural.rb
Last active January 24, 2016 03:56
Procedural Version of Circular Buffer
class CircularBuffer
class BufferEmptyException < IOError; end
class BufferFullException < IOError; end
attr_reader :data
def initialize(size)
@data = Array.new(size)
@read_index = 0
@write_index = 0
end
@Reltre
Reltre / circular_buffer.rb
Last active January 24, 2016 04:03
Object Oriented Circular Buffer
class CircularBuffer
class BufferEmptyException < IOError; end
class BufferFullException < IOError; end
attr_reader :data
def initialize(size)
@data = Array.new(size)
@reader = BufferReader.new
@writer = BufferWriter.new
end