Skip to content

Instantly share code, notes, and snippets.

View MiniAppleTheApple's full-sized avatar

MiniApple MiniAppleTheApple

  • Brasil RJ Rio de Janeiro
View GitHub Profile
@MiniAppleTheApple
MiniAppleTheApple / monoids.ex
Created December 5, 2022 00:02 — forked from martinos/monoids.ex
Monoid examples in elixir
defmodule Monoid do
defmacro __using__(_opts) do
quote do
def concat([head|tail]) do
append(head, concat(tail))
end
def concat([]) do
empty
@MiniAppleTheApple
MiniAppleTheApple / main.c
Last active December 2, 2022 01:24
Cat clone
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define BUFFER_CAPACITY 10
#define DEFAULT_BUFFER { \
calloc(BUFFER_CAPACITY, sizeof(char)), \
BUFFER_CAPACITY, \
} \
@MiniAppleTheApple
MiniAppleTheApple / main.rb
Last active July 4, 2025 21:49
Record implementation in ruby
relative_require "record"
class Record
record :a, :b
end
a = Record.new(a: 10, b: 20)
a = a.merge(b: 10)
p a