Skip to content

Instantly share code, notes, and snippets.

@elias19r
elias19r / foxbit-convert-values.php
Created December 15, 2016 02:50
Converting BRL to BTC and BTC to BRL using the public orderbook from FOXBIT Exchange
<?php
/**
* Converting BRL to BTC and BTC to BRL using the public orderbook from FOXBIT Exchange
*
* NOTE
* - use CURL to get the orderbook
* - use BCMath for arithmetic
*/
Verifying that "elias19r.id" is my Blockstack ID. https://onename.com/elias19r
@elias19r
elias19r / formatuintbase64.go
Created August 23, 2020 03:00
FormatUintBase64
package main
import "log"
func main() {
tests := []struct {
desc string
given uint64
expected string
}{
#!/bin/bash
file_path='./your-file.csv'
n_lines=5000
# tail -n +2 $file_path: Prints the whole file starting from the second line (skip header)
# split -l $n_lines - part_: Split the content into small files of $n_lines each named "part_*"
tail -n +2 "${file_path}" | split -l "${n_lines}" - part_
# For each part_*
# Informe aqui as receitas brutas mensais (faturamentos)
receitas_brutas_mensais = [
9_999.99,
]
cliente_reside_no_exterior = true
prolabore_atual = nil
# Salve e rode no terminal: ruby meus_impostos_pj.rb
describe "setting an attribute with value from a parameter" do
context "when parameter key is not present" do
it "does not assume any value for the attribute"
it "does not set the attribute"
end
context "when parameter key is present" do
context "when parameter value is not blank" do
it "sets value to the attribute"
end
@elias19r
elias19r / uuid.rb
Last active June 22, 2022 03:42
Encode/decode UUID string to/from Base64 string in Ruby
require 'base64'
class UUID
def self.encode64(uuid)
bytes_str = [uuid.delete('-')].pack('H*')
Base64.urlsafe_encode64(bytes_str, padding: false)
end
def self.decode64(base64)
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
- rubocop-thread_safety
AllCops:
TargetRubyVersion: 3.2.0
NewCops: enable

What do you think science is? There's nothing magical about science. It is simply a systematic way for carefully and thoroughly observing nature and using consistent logic to evaluate results. Which part of that exactly do you disagree with? Do you disagree with being thorough? Using careful observation? Being systematic? Or using consistent logic?

-- Steven Novella


language title date
pt-br
Não existe meia-entrada
2017-09-20

Ilustrando como se fosse uma resolução de questão de prova, queremos mostrar que a "meia-entrada" não existe, que se trata apenas de um preço virtual.

Questão