Skip to content

Instantly share code, notes, and snippets.

View kiyov09's full-sized avatar

Enrique Mejías kiyov09

  • Envato México
  • Guadalajara, Jalisco, México
  • X @kiyov09
View GitHub Profile
@kiyov09
kiyov09 / main.rs
Created February 4, 2024 00:31
Rust house builder
#![allow(unused)]
use std::marker::PhantomData;
/// Our beloved house
#[derive(Debug)]
struct House {
floors: u32,
rooms: u32,
has_garage: bool,
}
@kiyov09
kiyov09 / main.ml
Last active November 22, 2023 22:52
OCaml solution for AoC 2022 - Day 1
(**
AoC 2022
*)
module Day1 = struct
let input_file = "./inputs/day1/input.txt"
(** Read from a channel till there's no more to read *)
let read_all ch =
let rec aux acc ch =
@kiyov09
kiyov09 / main.rs
Last active August 5, 2023 00:45
My sync solution to the challenge presented by Dax (@thdxr) here: https://twitter.com/thdxr/status/1687449674934812672\?s\=20
use std::cell::RefCell;
type UserId = usize;
#[derive(Clone, Debug)]
struct User(UserId);
impl User {
fn new(id: UserId) -> Self {
Self(id)
}