Skip to content

Instantly share code, notes, and snippets.

View voidcoefficient's full-sized avatar

M Albuquerque voidcoefficient

View GitHub Profile
@voidcoefficient
voidcoefficient / logger
Created March 30, 2026 09:16
the bash logger
# @describe the bash logger
#
# AUTHOR: Marla Albuquerque <marla@albuque.com>
#
# @meta required-tools gum,argc
# @meta version beta
log_structure="layout"
set -e
# @meta version beta
# @meta require-tools gum,argc,jrnl,jq,cut
# @describe medicine tracker written in bash
#
# AUTHOR: Marla Albuquerque <marla@albuque.com>
#
MEDS_DIR="$HOME/.local/share/meds"
MEDS_FILE="$MEDS_DIR/list"

The Problem

Adding inner margins and padding to one component should be avoided. In one screen it may make sense to do this, but as soon as other screen doesn't require that margin, the component becomes incorrect. Do not create new components with inner margins. There are a few ways to undo this. Let's first create an incorrect example:

❌ Wrong

type ProfileCardItemProps = {
  label: string
  value: string
}

Baseado no capítulo de mesmo título do livro "The Rust Programming Language".

Closures: Funções anônimas que capturam seu ambiente

Closures em Rust são funções anônimas declaradas inline como um valor, simplificando certos patterns (como iteradores, que veremos no próximo capítulo). Você pode criar a closure em uma posição do código e depois chamá-la em outro lugar, executando-a num contexto diferente. Ao contrário de funções, closures podem capturar valores do ambiente nas quais foram definidas.

@voidcoefficient
voidcoefficient / sum.ts
Last active October 23, 2022 20:44
enterprise sum
// @ts-ignore
class NumberValidator {
number: number | undefined;
log = new Logger('NumberValidator');
constructor(n: any) {
this.log.log(`NumberValidator constructor called with ${n}`);
if (typeof n === 'string') {
this.log.error(`NumberValidator failed with string ${n}`);
@voidcoefficient
voidcoefficient / typeofvar.sh
Created August 23, 2022 16:46 — forked from CMCDragonkai/typeofvar.sh
Bash: Get the type of a variable
#!/usr/bin/env bash
typeofvar () {
local type_signature=$(declare -p "$1" 2>/dev/null)
if [[ "$type_signature" =~ "declare --" ]]; then
printf "string"
elif [[ "$type_signature" =~ "declare -a" ]]; then
printf "array"
@voidcoefficient
voidcoefficient / README.md
Created March 22, 2022 14:30 — forked from faermanj/README.md
TDC 2022 - Aplicacoes Seguras com Quarkus

Aplicações Seguras com Quarkus e Keycloak

Agenda

Aplicação estilo "microserviços" ("PetCare")

  • Agilidade
  • Segurança
                                       ┌────────┐
                                   ┌───┴──────┐ │
┌────────┐      ┌─────────┐      ┌─┴────────┐ │ │
@voidcoefficient
voidcoefficient / Todo.kt
Created December 24, 2021 16:21
Slinky Examples
@Entity
@Table(name = "todos")
data class Todo(
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
override var id: Long?,
var name: String?,
var description: String?,
var completed: Boolean?
) : IGenericEntity<Long>
❗️ Opened issue #2 in victoriaquasar/rust-rest-api
❗️ Opened issue #1 in victoriaquasar/rust-rest-api
❗️ Closed issue #2 in minsk-dev/cutest-cat
🗣 Commented on #2 in minsk-dev/cutest-cat
❌ Closed PR #1 in minsk-dev/cutest-cat
Kotlin +407/ -280 █████████████████████100.0%