Skip to content

Instantly share code, notes, and snippets.

View algebraic-dev's full-sized avatar
🏳️‍⚧️
Vem, me enlaça

Sofia Rodrigues algebraic-dev

🏳️‍⚧️
Vem, me enlaça
View GitHub Profile
@algebraic-dev
algebraic-dev / diversao.md
Last active October 14, 2021 18:22
Coisas divertidas da programação

Coisas que eu recomendo vcs usarem algum dia pq é divertido

DHALL - Linguagem de configuração incrivel

https://dhall-lang.org/

NIX - Package manager com gerações e que é reversivel e OS baseado nisso

https://nixos.org/

Unison - Language for distributed systems:

@algebraic-dev
algebraic-dev / serial.re
Created May 6, 2021 18:22
Simple code to read from serial port with termios in reasonML
open Unix;
let start = baud =>
try({
let fd = openfile("/dev/ttyUSB0", [O_RDWR], 0o640);
let tty = {
...tcgetattr(fd),
c_parenb: false,
c_cstopb: 1,
c_csize: 8,
c_icanon: false,
@algebraic-dev
algebraic-dev / simplifier.hs
Created March 31, 2021 21:54
Boolean equation simplifier in Haskell
module Main where
data Cuit
= Cuit :+: Cuit
| Cuit :*: Cuit
| Neg Cuit
| Var String
(-|) = Neg
@algebraic-dev
algebraic-dev / seqqbe.rs
Last active February 20, 2021 12:35
Algoritmo seqqbe do louco do Nosomy com unsafe por causa do maldito bound checking
// Nosomy's SEQQBE Algorithm implemented in rust by Chiyoku
use std::env;
use std::io::{self, Write};
use std::io::BufWriter;
fn out_vector(vector: &mut Vec<u8>,size: usize,stream: &mut std::io::BufWriter<std::io::StdoutLock>) -> u8{
let mut counter: u8 = 0xFF;
for pos in 0..size{
let y = unsafe { vector.get_unchecked_mut(pos) };
@algebraic-dev
algebraic-dev / problem.idr
Created February 19, 2021 12:23
The problem
module LexerTest
import Text.Lexer
import Data.List
data TokenKind =Sharp
Show TokenKind where
show Sharp = "#"
@algebraic-dev
algebraic-dev / site.asm
Created February 16, 2021 14:28
Site em assembly
section .data
struc sockaddr_in
.sin_family: resw 1 ; 2 bytes word pra family
.sin_port: resw 1 ; 2 bytes 1 word pra porta
.sin_addr: resd 1 ; 4 bytes double word pra endereço
.sin_zero: resb 8 ; 8 bytes em 0
endstruc
socket_err_msg db "Deu erro no socket bobao", 10
socket_err_len equ $-socket_err_msg ; Tamanho da mensagem
@algebraic-dev
algebraic-dev / jsoncsv.py
Created January 7, 2021 23:05
NESTED JSON to CSV in Python
import copy
import json
def flat_json(data, last_name = "", rows = [{}], keys = []):
last_row = rows[len(rows)-1]
if type(data) is dict:
lists = {}
for key in data:
name = last_name + ("__" if last_name else "") + key
if type(data[key]) is list: