Skip to content

Instantly share code, notes, and snippets.

View steinerkelvin's full-sized avatar

Kelvin Steiner steinerkelvin

View GitHub Profile
@steinerkelvin
steinerkelvin / chat.md
Created April 16, 2024 22:33
The Interplay of Conformity: Abilene Paradox, Pluralistic Ignorance, and Spiral of Silence — a Claude 3 Opus chat

User: Explain the relations between the Abilene Paradox, pluralistc ignorance and the spiral of silence.

Assistant: The Abilene Paradox, pluralistic ignorance, and the spiral of silence are related concepts in social psychology that deal with group dynamics, conformity, and decision-making processes. Here's how they are connected:

  1. Abilene Paradox:
  • Occurs when a group collectively decides on a course of action that is contrary to the preferences of most of the individuals in the group.
  • People go along with the decision to avoid conflict or to not "rock the boat," even though it's not what they want.
  • Results in a decision that no one really wants, but everyone feels pressured to agree to.
  1. Pluralistic Ignorance:
@steinerkelvin
steinerkelvin / result_adt_wip_madness.ts
Last active April 10, 2024 19:28
mad scientist TypeScript Result ADT
import { Enum, MatchDictFor, match } from "."
export type Option<T> = T | null
export type Result<T, E> = Enum<{
Ok: T,
Err: E,
}>
interface ResultI<T, E> {
@steinerkelvin
steinerkelvin / typed_getter_setter_closure.py
Created April 9, 2024 16:11
Typed Python getter-setter hook closure function
from typing import Callable, TypeVar, Generic, Protocol
T = TypeVar("T")
class SetterGetterFn(Generic[T], Protocol):
def __call__(self, x: T = ..., /) -> T:
...
def create_state_fn(default: Callable[..., T]) -> SetterGetterFn[T]:
"""
@steinerkelvin
steinerkelvin / README.md
Last active November 24, 2022 16:41
simple TLS/SSL termination with Traefik

simple TLS/SSL termination with Traefik

This is a simple Docker setup of a Traefik container to do SSL/TSL terminantion (you delegate SSL/TLS to another service instead of doing it in the application itself).

It works with applications running on the host (instead of another container) if using the following on Docker Compose:

 extra_hosts:
@steinerkelvin
steinerkelvin / keybase.md
Created June 28, 2022 16:04
Keybase verification for `steinerkelvin`

Keybase proof

I hereby claim:

  • I am steinerkelvin on github.
  • I am kelvinsantos (https://keybase.io/kelvinsantos) on keybase.
  • I have a public key ASB-bPsqg4-5Ptnh7nKuug7MReFWk--Td-CyZ6DRttsEAAo

To claim this, I am signing this object:

@steinerkelvin
steinerkelvin / rust_serde_json_enum_on_typescript.ts
Created June 17, 2022 14:12
Typescript typings and utility functions for Rust's serde / serde_json serialized enums (tagged unions)
// Some magic from
// https://stackoverflow.com/questions/65750673/collapsing-a-discriminated-union-derive-an-umbrella-type-with-all-possible-key
// I replaced `undefined` usages with the placeholder below so we can exclude
// it properly on the last definition.
declare const PLACEHOLDER: unique symbol
type Placeholder = typeof PLACEHOLDER
// Magic as far as I'm concerned.
@steinerkelvin
steinerkelvin / default.conf
Last active March 24, 2022 20:31
keyd v2 config
[ids]
04d9:a096
[main]
capslock = layer(custom_caps)
[custom_caps:M]
@steinerkelvin
steinerkelvin / auto_sprintf.c
Created February 21, 2022 21:02
auto_sprintf
#define ASPTF_ARGS _BUFFER, _TAM
/**
* Aloca automaticamente o espaço necessário para uma string formatada
* resultante de um "sprintf".
*
* @param dest Variável onde armazenar a string formatada resultante
* @param sptf Expressão de snprintf que deve ser do formato:
* `snprintf(ASPTF_ARGS, <formato>, ... )`, que é equivalente a:
* `snprintf(_BUFFER, _TAM, <formato>, ... )`
@steinerkelvin
steinerkelvin / keybase.md
Created April 29, 2021 21:48
keybase.md

Keybase proof

I hereby claim:

  • I am quleuber on github.
  • I am kelvinsantos (https://keybase.io/kelvinsantos) on keybase.
  • I have a public key whose fingerprint is BE92 46A5 D90D BD63 5629 0CE1 43E0 10F0 A5FA 8332

To claim this, I am signing this object:

@steinerkelvin
steinerkelvin / requirements_management.md
Last active June 17, 2022 14:07
Python's pip requirements management ala Node.js / npm / yarn
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip freeze > requirements_lock.txt
pip install -r requirements_dev.txt

requirements.txt