Skip to content

Instantly share code, notes, and snippets.

View noelworden's full-sized avatar

Noel Worden noelworden

View GitHub Profile

Keybase proof

I hereby claim:

  • I am noelworden on github.
  • I am noelworden (https://keybase.io/noelworden) on keybase.
  • I have a public key ASDfPA7xVsNbGyYBF0WfDVqhpxVqKtPdJku9SmEFni_gTQo

To claim this, I am signing this object:

@noelworden
noelworden / prying_debugging.md
Last active February 18, 2021 22:08
#helpers
@noelworden
noelworden / column_data07.ex
Created November 30, 2020 23:43
#blog_snippets
Mapping.create_destination()
@noelworden
noelworden / seed_command
Last active November 30, 2020 23:30
#blog_snippets
docker-compose web mix run priv/repo/seeds.exs
@noelworden
noelworden / seed_code.ex
Created November 30, 2020 23:28
#blog_snippets
Atlas.Mapping.CSVUtil.csv_row_to_table_record("priv/repo/data/destinations.csv")
@noelworden
noelworden / column_data10.ex
Last active April 26, 2023 07:03
#blog_snippets
defmodule Atlas.Mapping.CSVUtil do
@moduledoc """
Utility module to ingest `destination.csv`
"""
alias NimbleCSV.RFC4180, as: CSV
alias Atlas.{Mapping, Mapping.Destination, Repo}
def csv_row_to_table_record(file) do
column_names = get_column_names(file)
@noelworden
noelworden / column_data09.ex
Last active November 30, 2020 23:43
#blog_snippets
row["longitude"]
@noelworden
noelworden / column_data08.ex
Last active November 30, 2020 23:43
#blog_snippets
defp create_or_skip(row) do
case Repo.get_by(Destination,
latitude: row["latitude"],
longitude: row["longitude"]
) do
nil ->
Mapping.create_destination(%{
longitude: Decimal.new(row["longitude"]),
latitude: Decimal.new(row["latitude"]),
name: row["name"],
@noelworden
noelworden / column_data06.ex
Created November 30, 2020 23:23
#blog_snippets
|> create_or_skip()
@noelworden
noelworden / column_data05.ex
Created November 30, 2020 23:22
#blog_snippets
%{
"allows_dogs" => "true",
"backpack_camp" => "true",
"car_camp" => "false",
"car_friendly" => "true",
"description" => "Rumors of big fish, probably early in season. ~ 2.5 hr hike. Latest notes: 20190909",
"dogs_off_leash" => "true",
"fee" => "false",
"greater_than_three_hours" => "false",
"hike_in" => "true",