Skip to content

Instantly share code, notes, and snippets.

View ingenieroariel's full-sized avatar

Ariel Núñez ingenieroariel

View GitHub Profile
local mouseSpeed = 0.5
local touchSpeed = 0.1
local maxFov = 90
local minFov = 0.01
local maxPitch = 85
local minPitch = -85
local camera = {
vid = nil,
x@ceon:~/c/superconfigure/gui$ cat freetype-2.13.2/superconfigure
#!/usr/bin/env bash
set -e
shopt -s expand_aliases
# Check for COSMO directories
if [ -z ${COSMO+x} ]; then
echo "Could not find COSMO source directory!";
exit 1
fi
@ingenieroariel
ingenieroariel / flake.nix
Created November 3, 2023 16:21
Apple Silicon System NixOS
{
inputs.nixpkgs.url = github:NixOS/nixpkgs;
inputs.apple-silicon = {
url = github:tpwrules/nixos-apple-silicon;
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, apple-silicon, ... }@attrs: let
system = "aarch64-linux";
@ingenieroariel
ingenieroariel / flake.nix
Created November 3, 2023 16:10
Development Flake with devenv
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/63678e9f3d3afecfeafa0acead6239cdb447574c";
systems.url = "github:nix-systems/default";
devenv.url = "github:cachix/devenv";
};
outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
let forEachSystem = nixpkgs.lib.genAttrs (import systems); in {
devShells = forEachSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; in {
{ pkgs, ... }:
{
packages = with pkgs; [
git
google-cloud-sdk
(python311.withPackages(ps: with ps; [
pyarrow
duckdb
h3
@ingenieroariel
ingenieroariel / gist:cb1727a395c3dcbb9c3117592f743356
Created August 28, 2023 14:45
eglinfo on NixOS / Asahi Linux / M1 Ultra / OpenGL 3.1 compatible Mesa driver
[nix-shell:~]$ eglinfo
EGL client extensions string:
EGL_EXT_client_extensions, EGL_EXT_device_base,
EGL_EXT_device_enumeration, EGL_EXT_device_query, EGL_EXT_explicit_device,
EGL_EXT_platform_base, EGL_EXT_platform_device, EGL_EXT_platform_wayland,
EGL_EXT_platform_x11, EGL_EXT_platform_xcb,
EGL_KHR_client_get_all_proc_addresses, EGL_KHR_debug,
EGL_KHR_platform_gbm, EGL_KHR_platform_wayland, EGL_KHR_platform_x11,
EGL_MESA_platform_gbm, EGL_MESA_platform_surfaceless
@ingenieroariel
ingenieroariel / developers_github.txt
Created April 8, 2023 14:37
awesome-coders: An autogenerated list of notable coders
Linus Torvalds (Creator of the Linux Kernel) - https://github.com/torvalds
John Carmack (Co-founder of id Software) - https://github.com/ID_AA_Carmack
Bjarne Stroustrup (Creator of C++) - https://github.com/BjarneStroustrup
Fabrice Bellard (Creator of QEMU, FFMpeg, and Tiny C Compiler) - https://github.com/fbellard
Andrei Alexandrescu (C++ expert and author) - https://github.com/incomputable
Chandler Carruth (LLVM and Clang developer) - https://github.com/chandlerc
Daniel Lemire (Computer science researcher, focuses on performance) - https://github.com/lemire
P.J. Plauger - A renowned author, and contributor to the C Standard Library - https://github.com/pjplauger
Peter J. Weinberger - Co-creator of AWK and a contributor to Unix - https://github.com/pjw
Keith Packard - A prominent contributor to the X Window System, and the Linux graphics stack - https://github.com/keith-packard
import torch
import torch.nn as nn
from torch.autograd import Function
import wkv_cuda
# Forward function
# y = W * K + U * V
# W, U, K, V: matrices
# y: output matrix
def forward_wkv(B, T, C, w, u, k, v):
@ingenieroariel
ingenieroariel / art with new vulkan functions.md
Created March 20, 2023 15:58
Opportunities for Apple M1 Rust GPU driver in Generative Art

Visual Art with Vulkan

Human: Based on the text below, generate a recommendation for a new kind of visually stunning generative art that uses the most advance features.

Then along came Vulkan, and said there was a better way. In Vulkan, there is no explicit synchronization of buffers. Instead, the app developer is responsible for manually keeping track of dependencies between things they submit to the GPU, and Vulkan provides several tools to tell the system what it needs: barriers, events, fences, and timeline semaphores.

Vulkan is pretty complicated, so we won’t go into all the details… but essentially, these tools give the app fine-grained control over what has to wait for what and when. There is no implicit buffer synchronization any more, which is great! The kernel driver no longer needs to keep track of possibly dozens or hundreds of buffers, but instead only the very specific sync requirements that the app requests.

(By the way, Metal supports both explicit sync and implicit sync for some rea

@ingenieroariel
ingenieroariel / learning-ocaml.md
Created March 18, 2023 13:53
Learning OCaml with ChatGPT4

OCaml mean of CSV.

Human: Please write OCaml code that opens a csv, calculates the mean of each column and outputs it to stdout.


Assistant:

To achieve this task in OCaml, you can use the csv library to read and parse the CSV file. You can install it using opam install csv. Here's a simple example that calculates the mean of each column and prints it to stdout: