Skip to content

Instantly share code, notes, and snippets.

View marlalain's full-sized avatar
🫖
HTTP 418

Marla Lain marlalain

🫖
HTTP 418
View GitHub Profile

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.

@marlalain
marlalain / 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}`);
@marlalain
marlalain / 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"
@marlalain
marlalain / 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
                                       ┌────────┐
                                   ┌───┴──────┐ │
┌────────┐      ┌─────────┐      ┌─┴────────┐ │ │
@marlalain
marlalain / 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%
@marlalain
marlalain / ygif.py
Last active December 21, 2023 18:42
Youtube to GIF [Python]
# Youtube to GIF Converter
# (with youtube-dl and ffmpeg)
# made by Paulo Elienay II
# at paulo [at] pauloelienay.com
# imports
import sys, os
# vars
# default vars