Skip to content

Instantly share code, notes, and snippets.

View tiagoefmoraes's full-sized avatar

Tiago Moraes tiagoefmoraes

View GitHub Profile
@tiagoefmoraes
tiagoefmoraes / date_time_generators.ex
Created December 8, 2023 01:16 — forked from LostKobrakai/date_time_generators.ex
stream_data generators to create elixir date/time structs
defmodule DateTimeGenerators do
use ExUnitProperties
@time_zones ["Etc/UTC"]
def date do
gen all year <- integer(1970..2050),
month <- integer(1..12),
day <- integer(1..31),
match?({:ok, _}, Date.from_erl({year, month, day})) do
@tiagoefmoraes
tiagoefmoraes / phoenix.md
Last active December 16, 2021 01:13 — forked from teamon/phoenix.md
Run Phoenix inside LiveBook

Phoenix in LiveBook

Info

You can import this Gist directly into your LiveBook instance.

Setup

Mix.install([:jason, :plug_cowboy, :phoenix, :phoenix_html, :phoenix_live_view])
@tiagoefmoraes
tiagoefmoraes / gist:92efc670dcdb8194b481a1e3e8b0d688
Created August 8, 2017 16:35 — forked from ninthspace/gist:4360267
How I migrated from rbenv to chruby, and kept per-project gems nice and tidy.

Remove rbenv and any rubies, gems etc.:

$ rm -rf ~/.rbenv

Uninstall rbenv if installed via Homebrew

$ brew uninstall rbenv

Remove references to rbenv in ~/.bash_profile etc.

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
@tiagoefmoraes
tiagoefmoraes / big_decimal_inspect.rb
Created March 5, 2015 15:39 — forked from henrik/big_decimal_inspect.rb
Better BigDecimal inspect for tests and diffs
class BigDecimal
def inspect
format("#<BigDecimal: %s>", to_s('F'))
end
end
def escangalha_tudo obj, com_putaria=false
methods = obj.methods
#methods = obj.methods - Object.methods
methods.sort!
methods.each do |method|
clone = obj.clone
begin
puts "Method = #{method} => #{clone.send method}" unless !com_putaria and [:debugger, :breakpoint].include? method
rescue Exception => e