Skip to content

Instantly share code, notes, and snippets.

// na planilha:
// =CONCATENATE("run('", SUBSTITUTE($A$1,"EXTRATO ANALÍTICO - ",""), "', '", SUBSTITUTE(SUBSTITUTE(D8, ".", ""), ",", "."), "', '", B8, "', '", SUBSTITUTE(SUBSTITUTE(C8, ".", ""), ",", "."), "', '", A8, "')")
function run(asset, total, qty, price, date) {
new Date(date.split("/")[1] + '/' + date.split("/")[0] + '/' + date.split("/")[2]).toISOString().substring(0, 10)
fetch("https://myprofitweb.com/API/NewAsset", {
"headers": {
"accept": "*/*",
"accept-language": "en-US,en;q=0.9,pt-BR;q=0.8,pt;q=0.7",
---
version: "3.3"
services:
plex:
image: linuxserver/plex:latest
container_name: plex
environment:
- PUID=1000
- PGID=1000
- VERSION=docker

Writing extensible Elixir

whoami

  • Milhouse (Renan Ranelli)
  • Currently @ Podium.com
  • Working with Elixir since 2015

DISCLAIMER: Esse texto é todo minha opinião. Onde cabe referência vai ter referência. Onde não tem referência eu basicamente estou tirando do meu cu mesmo. Leia por sua conta e risco.

Senioridade

Pois bem. A treta da vez na comunidade dev agora é sobre o que é ou deixa de ser “um senior”, o que é razoável pra “um senior” fazer ou deixar de fazer.

Geralmente esse tipo de assunto passa no meu radar e cai direto no /dev/null mas

defmodule ControlPlane.CircuitBreakerTest do
use ExUnit.Case
import ExUnit.Callbacks
alias ControlPlane.CircuitBreaker
defmodule Worker do
use GenServer
alias ControlPlane.CircuitBreaker
defmodule CircuitBreaker do
use Supervisor
defstruct [
:circuit_ref,
:worker_module,
ets: :circuit_breaker_states,
restart_period_ms: 500,
defmodule CircuitBreaker do
@moduledoc """
`CircuitBreaker` is a `decorator` module for supervisor children that changes the default supervisor restart policy.
Instead of instantly restarting an exited children, like a normal supervisor
would do, `CircuitBreaker` will instead change its status to `in_break` (i.e.
the worker is `unnavailable`) and schedule a restart of the children after a
configured `delay`. If the children fails to start, the status is kept
`in_break` and a new restart is scheduled. If the children starts
successfully, then the status is changed back to `normal`.
defmodule Pentabonacci do
import Integer, only: [is_odd: 1]
defp calc(0, _), do: 0
defp calc(1, _), do: 1
defp calc(2, _), do: 1
defp calc(3, _), do: 2
defp calc(4, _), do: 4
defp calc(n, ets) do
defmodule Pentabonacci do
import Integer, only: [is_odd: 1]
defp calc(0, _), do: 0
defp calc(1, _), do: 1
defp calc(2, _), do: 1
defp calc(3, _), do: 2
defp calc(4, _), do: 4
defp calc(n, ets) do
defmodule Pentabonacci do
import Integer, only: [is_odd: 1]
defp calc(0, _), do: 0
defp calc(1, _), do: 1
defp calc(2, _), do: 1
defp calc(3, _), do: 2
defp calc(4, _), do: 4
defp calc(n, ets) do