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
# 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. |
# 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:
@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 |
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 |
{ | |
"Inspect": { | |
"prefix": "ins", | |
"body": "|> IO.inspect(label: \"$0$TM_LINE_NUMBER\")", | |
"description": "Adds a pipeline with a labelled `IO.inspect`", | |
} | |
} |
// assets/js/app.js | |
// ... | |
import Pickr from "./pickr" | |
const hooks = { | |
Pickr | |
} | |
// ... |
CREATE OR REPLACE FUNCTION rebuild_view() RETURNS event_trigger AS | |
$rebuild_view$ | |
DECLARE | |
table_name text; | |
view_name text; | |
BEGIN | |
SELECT object_identity INTO table_name FROM pg_event_trigger_ddl_commands() LIMIT 1; | |
SELECT split_part(table_name, '.', 1) || '.v_' || split_part(table_name, '.', 2) | |
INTO view_name; | |
EXECUTE 'DROP VIEW IF EXISTS ' || view_name; |
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/ |