Skip to content

Instantly share code, notes, and snippets.

View zorn's full-sized avatar
💸
Elixir Contractor For Hire

Mike Zornek zorn

💸
Elixir Contractor For Hire
View GitHub Profile
// @ts-check
//
// ☝🏽 The line above enables type checking for this file. Various IDEs interpret
// the @ts-check directive. It will give you helpful autocompletion on the web
// and supported IDEs when implementing this exercise. You don't need to
// understand types, JSDoc, or TypeScript in order to complete this JavaScript
// exercise, and can completely ignore this comment block and directive.
// 👋🏽 Hi there!
//
defmodule Franklin.DataCase do
@moduledoc """
This module defines the setup for tests requiring
access to the application's data layer.
You may define functions here to be used as helpers in
your tests.
Finally, if the test case interacts with the database,
we enable the SQL sandbox, so changes done to the database

Tic-Tac-Toe Elixir Code Jam

Summary

To enable a productive group discussion about code design issues and approaches the Philly Elixir meetup group will run a short code jam style event. During the November 2021 meeting the code jam concept and goals will be shared. During the December 2021 meeting each member who has chosen to participate will have the opportunity to present their solution and take questions. The goal is by having different people solve for the same problem we can quickly observe different coding approaches and learn from each other.

Acceptance Criteria

For this code jam we will be building an Elixir module that can run a basic tic-tac-toe game. There is no required UI component, in fact for the purpose of our show and tell I'd like to keep us focused on the game module but that said, if you want to do extra credit feel free.

@zorn
zorn / sample.ex
Last active September 26, 2021 23:57
How we use `Kernal.match/2` to validate that a list has an expected value.
# chunk of code from our tests where we validated that an expected metric was captured
# heavily edited out company info
metrics =
capture_metrics(fn ->
with_trace(fn ->
assert {:ok, _result} = Work.stuff()
end)
end)
assert Enum.any?(

Ecto Changeset Demo and Talk

What is Ecto?

  • Historic personal use of Active Record pattern in PHP, Rails, iOS dev.
  • Ecto described itself as a toolkit for data mapping and language integrated query for Elixir.
  • Changeset were (for me) a new concept that I've really come to appriciate.

Many of the demos you'll see come from Ecto's own Getting Started and I encourage you to check it out as well.

Name of Ticket [Fixes #xxx]

Finishes

link_to_ticket

Additions / Changes

Update the CHANGELOG and paste the description here:

@zorn
zorn / good-sdk.md
Last active February 24, 2020 21:08
Early notes on what makes a good sdk

What makes a good SDK?

Real world example of usage

  • Example apps
    • Mayeb do them in Swift, React Native, Flutter, etc.
  • Example playgrounds?

Good documentation

  • README
  • General overview of SDK behaviors
Links:
https://elixir-lang.org/learning.html
https://exercism.io/tracks/elixir
https://github.com/happi/theBeamBook
https://www.manning.com/books/elixir-in-action
@zorn
zorn / gist:c8899c6a774988e416a132678c545ffd
Last active July 26, 2018 23:24
new phx app not getting new template?
PROBLEM:
When I make a new phx app I expect the app template to match what I see in GitHub but it doesn't.
Locally in the layout template I get:
<li><a href="http://www.phoenixframework.org/docs">Get Started</a></li>
But on GitHub it's seems to be:
@zorn
zorn / list.md
Created October 13, 2017 15:06
TNG / Random Trek List

Season One