Skip to content

Instantly share code, notes, and snippets.

# frozen_string_literal: true
class TestRequestHelper
def self.build(
method: 'GET',
url: 'http://test.upper.town/',
params: {},
headers: {},
env: {},
remote_ip: '1.1.1.1',
# irb -r ./docker_methods.rb
# Postgres
def docker_create_postgres(app_name, version: '15.6', port: '5432', user: nil, password: nil)
user ||= app_name
password ||= app_name
%x[
docker network create \
@elias19r
elias19r / mbecop.sh
Created July 25, 2023 21:02
mbecop: Run rubocop only on modified files
function mbecop() {
{
git diff-tree -r --no-commit-id --name-only HEAD main;
git ls-files -m
} | xargs ls -1 2>/dev/null | grep '\.rb$' | xargs bundle exec rubocop --force-exclusion
}
{
"editor.fontSize": 13,
"editor.rulers": [
80,
120
],
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"editor.renderWhitespace": "trailing",
"editor.fontFamily": "JetBrains Mono",
[desktop]
trash-icon-visible=true
[list-view]
default-column-order=['name', 'size', 'type', 'mime_type', 'date_modified', 'group', 'owner', 'permissions', 'date_created_with_time', 'date_accessed', 'date_created', 'detailed_type', 'where', 'date_modified_with_time', 'octal_permissions']
default-visible-columns=['name', 'size', 'type', 'mime_type', 'date_modified', 'owner', 'permissions']
[preferences]
confirm-move-to-trash=true
date-format='iso'
[/]
alttab-switcher-delay=100
desklet-snap-interval=25
enabled-applets=['panel1:left:0:[email protected]:0', 'panel1:right:3:[email protected]:3', 'panel1:right:4:[email protected]:4', 'panel1:right:5:[email protected]:5', 'panel1:right:6:[email protected]:6', 'panel1:right:7:[email protected]:7', 'panel1:right:8:[email protected]:8', 'panel1:right:9:[email protected]:9', 'panel1:right:10:[email protected]:10', 'panel1:right:11:[email protected]:11', 'panel1:right:12:[email protected]:12', 'panel1:right:2:[email protected]:21', 'panel1:left:1:[email protected]:22', 'panel2:left:0:[email protected]:23', 'panel1:right:14:[email protected]:25', 'panel1:right:0:cinnamon-timer@jake1164:26']
enabled-desklets=@as []
hotcorner-layout=['expo:false:0', 'scale:false:0', 'scale:false:0', 'desktop:false:0']
next-applet-id=27
no-adjacent-panel-barriers=true
panel-edit-mode=false
panel-zone-icon-sizes='[{"panelId":1,"left":0,"center":0,"right
# frozen_string_literal: true
class Result
extend ActiveModel::Naming # Required dependency for ActiveModel::Errors
GENERIC_ERROR = :generic_error
attr_reader :errors, :data
alias attributes data
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.

{
"keyboard": "durgod/k320/base",
"keymap": "default",
"layout": "LAYOUT_all",
"layers": [
[
"KC_CAPS", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "KC_PSCR", "KC_SCRL", "KC_PAUS",
"KC_GRV", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_EQL", "KC_BSLS", "KC_INS", "KC_HOME", "KC_PGUP",
"KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_LBRC", "KC_RBRC", "KC_BSPC", "KC_DEL", "KC_END", "KC_PGDN",
"MO(1)", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_NUHS", "KC_ENT",