Skip to content

Instantly share code, notes, and snippets.

@sorentwo
sorentwo / recording_output_with_pro.livemd
Created February 21, 2022 14:15
Demonstration of using Oban job output with Pro's Relay and Workflow

Recording Output with Oban Pro

Setup

To get started, install Oban, Pro, and our dependencies. Note that the oban_pro install requires a working Pro license.

Mix.install([

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@jodosha
jodosha / bench.rb
Last active October 13, 2022 05:15
Ruby benchmark: Array#uniq vs Set#to_a
#!/usr/bin/env ruby
require "benchmark/ips"
require "set"
INPUT = 100.times.map { "my-test-string" }.freeze
Benchmark.ips do |x|
x.report("Array#uniq") { INPUT.uniq }
x.report("Set#to_a") { Set.new(INPUT).to_a }
  • Por que fazer testes?
    • saber se o software está funcionando de maneira automatizada
      • não elimina os testes exploratórios feito de forma manual
    • manter custos de desenvolvimento em níveis saudáveis
    • ajuda na qualidade interna do código (design e arquitetura do código)
  • Como avaliar a qualidade dos testes (se estão bem feitos)?
    • corretude - se o teste não está gerando um falso positivo
  • adequação do tipo de teste - se o teste é o mais adequado para a situação
@shadowmaru
shadowmaru / slides.md
Last active November 26, 2020 07:17
Palestras da RubyConf BR 2017
@seanmhanson
seanmhanson / ableismSanityCheck.md
Created April 3, 2017 16:17
Ableist Language in Code: Sanity Check

Ableist Language in Code: Sanity Check

Removing ableist language in code is important; it helps to create and maintain an environment that welcomes all developers of all backgrounds, while emphasizing that we as developers select the most articulate, precise, descriptive language we can rather than relying on metaphors. Quite simply, avoiding ableist language lets us make sure we are inclusive of all developers, while moving toward language that is simultaneously more acccessible to developers whose first language might not be our own.

The phrase sanity check is ableist, and unnecessarily references mental health in our code bases. It denotes that people with mental illnesses are inferior, wrong, or incorrect, and the phrase sanity continues to be used by employers and other individuals to discriminate against these people.

There are a ton of alternatives, and one of the best ways to select one is to ask yourself: What am I actually checking? and select something more descriptive. In everyday c

@jadlr
jadlr / pushbutton.ex
Last active November 14, 2023 14:51
`gen_statem` example rewritten to elixir (http://erlang.org/doc/design_principles/statem.html)
defmodule PushButton do
@behaviour :gen_statem
@name :pushbutton_statem
# Client API
def start do
:gen_statem.start({:local,@name}, __MODULE__, [], [])
end
@ankurk91
ankurk91 / bash_profile.md
Last active October 22, 2023 12:16
:octocat: Git branch name in Linux/Mac Bash Terminal

Mac OS : Show your git branch name on your bash terminal

⚠️ Does not work in zsh terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@milmazz
milmazz / imposter-handbook-links.md
Last active April 1, 2024 10:31
Useful links found in The Imposter's Handbook by Rob Conery
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active June 19, 2024 18:05
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key