- @idlehands: I don't post new things
- @[email protected]: if I post new things, it's here
- [email protected]: I like to help people
- Testing Elixir Book: the sample code is downloadable without buying the book
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assert_values_for( | |
expected: quote_request, | |
actual: quote, | |
fields: fields_for(OmniWeb.Schema.QuoteRequest), | |
field_name_translations: [ | |
# explicit | |
origin_postal_code: [actual: :origin_zip], | |
destination_postal_code: [expected: :destination_zip, actual: :destination_zipcode], | |
# implicit | |
pieces: :freight_pieces, # assumes field is from expected and that this is on actual? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# option 1 - new function | |
assert_values_for_in_list( | |
expected_list: {[thing_1, thing_1], :string_keys}, | |
actual_list: return_value, # is list in all the examples | |
ordered: true, | |
fields: fields_for(Thing) | |
) | |
assert_values_for_in_list( | |
expected_list: [thing_2, thing_1], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmacro validate_schema_fields_and_types(schema, expected_schemas_and_types) do | |
quote do | |
test "#{unquote(schema)}: it has the correct fields and types" do | |
schema = unquote(schema) | |
expected_schemas_and_types = unquote(expected_schemas_and_types) | |
actual_fields_with_types = | |
for field <- schema.__schema__(:fields) do | |
type = field_type(schema, field) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crowd sources replacements | |
voting | |
some form of accountability | |
can you see other things that person has suggested, what they've voted on? | |
some way to protect people from seeing offensive words (maybe some sort of first letter and then a blur or redaction) | |
in the future maybe allow people to identify minority groups they belong to | |
word | |
- reason it should go away | |
- replacement words |
- @idlehands: I don't post new things
- @[email protected]: if I post new things, it's here
- [email protected]: I like to help people
- Testing Elixir Book: the sample code is downloadable without buying the book
- @idlehands DMs are open
- [email protected]
- Testing Elixir Book: the sample code is downloadable without buying the book
- Coveralls Coverage Library
- Mox library for test doubles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a log of these assume the exsistence of a branch called `utility` | |
# the code in `utility` doesn't have to be up to date | |
function reset_develop { | |
git checkout utility | |
git branch -D develop | |
git fetch | |
git checkout -b develop origin/develop | |
} |
I hereby claim:
- I am idlehands on github.
- I am idlehands303 (https://keybase.io/idlehands303) on keybase.
- I have a public key whose fingerprint is 7E87 12E1 A24D A99F 9EB7 0B4E 482E 0B55 4C73 0F2E
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# by Andronik Ordian | |
# updated by Jeffrey Matthias | |
Segment = Struct.new("Segment", :start, :end) | |
def optimal_points(segments) | |
points = [] | |
return points if segments.empty? | |
#write your code here |
NewerOlder