Skip to content

Instantly share code, notes, and snippets.

@ideaMarcos
ideaMarcos / random_case.ex
Last active January 8, 2025 05:48
defmodule ExMachinaHelper do
@doc """
Converts all characters in the given string to a random case according to `:default` mode.
Useful for writing tests where sorting is of importance.
## Examples
iex> ExMachinaHelper.random_case("abcdef")
"AbCdEf"
@ideaMarcos
ideaMarcos / install.sh
Last active January 8, 2025 05:49
homebrew postgresql
#!/bin/sh
brew install postgresql
brew services start postgresql
createdb `whoami`
# https://stackoverflow.com/questions/15301826/psql-fatal-role-postgres-does-not-exist
psql # to test login works
createuser -s postgres -P
psql -U postgres # to test login works