Skip to content

Instantly share code, notes, and snippets.

View mitchellhenke's full-sized avatar

Mitchell Henke mitchellhenke

  • GSA (work) + Personal Projects
  • Milwaukee, WI
View GitHub Profile
@mitchellhenke
mitchellhenke / point.ex
Created March 8, 2024 01:25
Sqlite Point
defmodule Sqlite.EctoTypes do
defmodule Point do
use Ecto.Type
def type, do: :binary
def cast(%Geo.Point{} = point), do: {:ok, point}
def cast(_), do: :error
def load(data) when is_binary(data) do
@mitchellhenke
mitchellhenke / upgrade.md
Last active July 13, 2020 15:05
Sentry 7.x -> 8.x Upgrade Guide

Sentry 8.0

Sentry Elixir 8.0 is a major release containing significant changes, particularly around Elixir's major improvements to the core Logger module. Because of that, the required Elixir version will be Elixir 1.10. There are also a handful of steps to complete the upgrade below. A special thank you goes to José Valim for his help and contributions to this release.

A more detailed explanation of the changes is below, with instructions to upgrade, but the summary of changes is:

  • Enhancements
    • Cache environment config in application config (#393)
    • Allow configuring LoggerBackend to send all messages, not just exceptions (e.g. Logger.error("I am an error message"))
@mitchellhenke
mitchellhenke / upgrade.md
Last active September 2, 2019 15:48
Sentry 6.x to 7.x Upgrade Guide

Bump your sentry dep

def deps do
  [
    {:sentry, "~> 7.0"},
  ]
end
@mitchellhenke
mitchellhenke / scout_apm_httpoison.ex
Last active April 18, 2018 00:08 — forked from itsderek23/scout_apm_httpoison.ex
Scout HTTPoison Instrumentation
# Instruments HTTPoison calls.
#
# Example usage:
#
# defmodule DemoWeb.PageController do
# use DemoWeb, :controller
# alias Demo.HTTPClient
#
# def index(conn, _params) do
# case HTTPClient.get("https://cnn.com") do
@mitchellhenke
mitchellhenke / upgrade.md
Last active August 29, 2017 20:24
Sentry 5.0.0 to 6.0.0 Upgrade Instructions

Sentry 6.0.0

This release contains a number of changes, including some backwards incompatible ones.

Bump your sentry dependency

def deps do
  [{:sentry, "~> 6.0"},
   ...]
@mitchellhenke
mitchellhenke / upgrade.md
Last active April 20, 2017 19:21
Sentry 3.0.0 to 4.0.0 Upgrade Instructions

Sentry 4.0.0

This release contains a significant number of changes, including some backwards incompatible ones.

Bump your sentry dependency

def deps do
  [{:sentry, "~> 4.0"},
 ...]

Keybase proof

I hereby claim:

  • I am mitchellhenke on github.
  • I am mitchellhenke (https://keybase.io/mitchellhenke) on keybase.
  • I have a public key whose fingerprint is AF0E D07A EBCF 1C10 E322 1D22 E8B4 95EE B979 509F

To claim this, I am signing this object:

1) test node_name/1 returns the node name (Phoenix.PubSubTest)
deps/phoenix_pubsub/test/shared/pubsub_test.exs:68
** (MatchError) no match of right hand side value: []
stacktrace:
lib/phoenix/pubsub.ex:287: Phoenix.PubSub.call/3
deps/phoenix_pubsub/test/shared/pubsub_test.exs:69: (test)
Finished in 0.3 seconds
defmodule App.Mixfile do
use Mix.Project
def project do
[app: :app,
version: "0.0.1",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
defmodule User do
use Ecto.Model
schema "users" do
field :username, :string
end
def search(query, search_term, limit = 0.3) do
from(u in query,
where: fragment("similarity(?, ?) > ?", u.username, ^search_term, ^limit),