Application.put_env(:sample, Example.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 5001],
server: true,
live_view: [signing_salt: "aaaaaaaa"],
secret_key_base: String.duplicate("a", 64)
)
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
Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
ActivityTweet | |
generic_activity_highlights | |
generic_activity_momentsbreaking | |
RankedOrganicTweet | |
suggest_activity | |
suggest_activity_feed | |
suggest_activity_highlights | |
suggest_activity_tweet |
Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.
These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.
Create a Dokku app:
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
# You will need fswatch installed (available in homebrew and friends) | |
# The command below will run tests and wait until fswatch writes something. | |
# The --stale flag will only run stale entries, it requires Elixir v1.3. | |
fswatch lib/ test/ | mix test --stale --listen-on-stdin |
by 0xabad1dea September 2018
You may notice a decidedly Nintendo bias to the examples. I can't change who I am.
Speedrunning is:
- Completing a video game
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
# For simpler use cases, see the UsesTracker instead: | |
# https://gist.github.com/christhekeele/e858881d0ca2053295c6e10d8692e6ea | |
### | |
# A way to know, at runtime, what modules a module has used at compile time. | |
# In this case, you include `IndirectUsesTracker` into a module. When that module gets | |
# used in some other module, it makes that module registerable under a namespace of your choosing. | |
# When the registerable module is used into a third module, that third module will know at runtime which | |
# registerables were `use`d in it at compile time, via a function titled after the namespace. |
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
defmodule HendricksFormatter do | |
@moduledoc """ | |
This module is a formatter plugin for Elixir's `mix format` task | |
that converts leading whitespace to tabs. | |
It tries to intelligently determine the tab width based on the most common | |
counts of leading space runs in the file. | |
It allows additional space characters for minor adjustments that are below the tab width. | |
OK, why tabs? Why resurrect this age-old nerd debate again? | |
Very simple: It's an accessibility issue: | |
https://adamtuttle.codes/blog/2021/tabs-vs-spaces-its-an-accessibility-issue/ |
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
@doc""" | |
Returns a map containing all files and their contents from the compressed tar archive. | |
""" | |
def extract_tar_from_binary(binary) do | |
with {:ok, files} <- :erl_tar.extract({:binary, binary}, [:memory, :compressed]) do | |
files | |
|> Enum.map(fn {filename, content} -> {to_string(filename), content} end) | |
|> Map.new | |
end | |
end |
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
# For more elaborate use cases, see the IndirectUsesTracker instead: | |
# https://gist.github.com/christhekeele/fc4e058ee7d117016b9b041b83c6546a | |
### | |
# A way to know, at runtime, what modules a module has used at compile time. | |
# In this case, you include `UsesTracker` into a module. When that module gets | |
# used in some other module, it registers itself with the other module. | |
## | |
defmodule UsesTracker do | |
A micro-gem DSL for compound conditionals.
Allowable lets you decompose large/long conditional chains into readable, testable, and inspectable segments with Ruby blocks.
NewerOlder