Skip to content

Instantly share code, notes, and snippets.

View elias19r's full-sized avatar

Elias Rodrigues elias19r

  • Remote
  • 12:25 (UTC -03:00)
View GitHub Profile
[
{
"key": "cmd+w",
"command": "-workbench.action.closeGroup",
"when": "activeEditorGroupEmpty && multipleEditorGroups"
},
{
"key": "cmd+w",
"command": "-workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups"
function us_cpi() {
try {
const url = "https://api.bls.gov/publicAPI/v1/timeseries/data/CUUR0000SA0"
const response = UrlFetchApp.fetch(url)
const data = JSON.parse(response.getContentText())
if (data && data.Results && data.Results.series && data.Results.series.length > 0) {
const currentData = data.Results.series[0].data[0]
const previousYearData = data.Results.series[0].data[13]
[
{
"key": "ctrl+; c",
"command": "rubyLsp.runTestInTerminal"
}
]
language title date
en-us
How two's complement works
2018-01-10

Two's complement is widely used to represent integer numbers in computers. We'll explain how it works with examples and justify why it works by mapping it onto modular arithmetic.

language title date
pt-br
Indução matemática com fórmula de juros composto
2017-12-02

Como um exercício de hipótese de indução, geralmente tenta-se encontrar a "fórmula fechada" correspondente a uma dada fórmula recursiva. Aqui vamos fazê-lo usando como exemplo o cálculo de juros composto.

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


@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)
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
#!/usr/bin/env ruby
# Informe aqui as receitas brutas mensais (faturamentos)
receitas_brutas_mensais = [
9_999.99,
]
cliente_reside_no_exterior = true
prolabore_atual = nil
@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
}{