Skip to content

Instantly share code, notes, and snippets.

View arthurmco's full-sized avatar
💭
..........

Arthur Mendes arthurmco

💭
..........
View GitHub Profile
@arthurmco
arthurmco / ecos.md
Created March 3, 2024 06:24
Continho do ChatGPT

Título: Ecos do Amanhã

Capítulo 1: A Partida

No ano de 2145, a humanidade deu seu mais ambicioso passo em direção às estrelas: a missão Atlas foi lançada, destinada a colonizar Proxima Centauri b, um exoplaneta a 16 anos-luz de distância da Terra. A bordo da nave Colossus, uma tripulação de 150 almas embarcou em uma jornada que duraria 160 anos, atravessando as vastidões do espaço em animação suspensa, com a esperança de um novo começo em um mundo distante.

A Colossus era uma obra-prima da engenharia espacial, equipada com o que havia de mais avançado em tecnologia de propulsão sublumínica, reciclagem de recursos e suporte à vida. Cada membro da tripulação foi escolhido a dedo por suas habilidades e sua capacidade de contribuir para o sucesso da missão, desde cientistas e engenheiros a médicos e especialistas em agricultura.

Capítulo 2: Além do Conhecido

@arthurmco
arthurmco / Cargo.toml
Created May 25, 2022 05:06
Rust template for a running OpenGL program
[package]
name = "async-gl-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
build = "build.rs"
[dependencies]
sdl2 = "0.35.2"
@arthurmco
arthurmco / fline.nix
Last active November 2, 2021 10:31
Familyline nix-build recipe
with import <nixpkgs> {};
runCommand "bash"
{
nativeBuildInputs = with pkgs; [cmake gcc git git-lfs pkgconfig python3];
buildInputs = [
curl
curlpp
SDL2
SDL2_image

Keybase proof

I hereby claim:

  • I am arthurmco on github.
  • I am arthurmco (https://keybase.io/arthurmco) on keybase.
  • I have a public key ASAvGL6w1ZFkyd9c4xSY2BeTsF-NRL1Tcu7UwFSStHUCWQo

To claim this, I am signing this object:

@arthurmco
arthurmco / README.md
Created October 29, 2021 14:24 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@arthurmco
arthurmco / dh_botan.cpp
Last active June 27, 2021 21:10
Diffie-Hellman key exchange using Botan
/**
* Diffie-Hellman key exchange using botan
*
* This code will fork two processes: one being the server (A) and other being the client (B)
*
* They will only share the exponent, any other value is independent and must be passed through
* the socket. The goal is for both to get the same key
*
* Compiled using
* $ g++ dh_botan.cpp --std=c++20 -Wall -Wextra -I/usr/include/botan-2 -lbotan-2 -o dh_botan
@arthurmco
arthurmco / sensors.cpp
Created December 9, 2020 00:25
read sensor information on linux
#include <cstdio>
#include <cstdlib>
#include <string>
#include <sensors/sensors.h>
#include <sensors/error.h>
/**
* Reads informations of all sensors and print them, a little bit rawish
*
@arthurmco
arthurmco / fixed.cpp
Last active October 18, 2020 21:39
A small file with an example of fixed-point decimal arithmetic in c++
// DecimalMode.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
// a constexpr power of 10 function
constexpr double pow10(int decs) {
if (decs >= 0) {
double v = 1;
for (auto i = 0; i < decs; i++) {
@arthurmco
arthurmco / sortoftrait.cpp
Created August 30, 2020 04:04
c++ traits, more or less
#include <string>
#include <sstream>
/// sort-of trait system using template specialization
///
/// It is better than inheritance.
/// Avoid the object to inherit from a lot of places.
/// Instead, you can create a trait, and the user "implement" that.
///
/// read https://accu.org/index.php/journals/442 for more insights
@arthurmco
arthurmco / main.cpp
Created April 28, 2020 19:44
SDL rainbow
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <cstdio>
#include <string>
#include <cstdint>
#include <glm/glm.hpp>
#include <cmath>
glm::vec3 HSVtoRGB(glm::vec3 HSV)
{