Skip to content

Instantly share code, notes, and snippets.

View Asmilex's full-sized avatar

Asmilex Asmilex

View GitHub Profile
@Asmilex
Asmilex / main.rs
Last active December 3, 2023 09:16
Simple simulation for the two body problem implemented in Rust
use std::{fmt::Debug, io, str::FromStr};
// ─── Helper Functions ────────────────────────────────────────────────────────
/// Calculates the euclidean distance between the two bodies.
/// Given our assumptions, we don't need to be so rigorous with the distance formula
fn distance(a: &CelestialBody, b: &CelestialBody) -> f32 {
let x = a.position.0 - b.position.0;
let y = a.position.1 - b.position.1;
(x.powi(2) + y.powi(2)).sqrt()
@Asmilex
Asmilex / README.md
Created December 27, 2022 11:33
Automatización de backups con Restic

Estrategia de backups

Programa clave: Restic - backups done right!.

TL:DR

  1. Inicializa el repositorio. No pierdas la contraseña.
restic init --repo repositorio
@Asmilex
Asmilex / cheat_sheet.md
Last active January 22, 2021 12:24
Cheat sheet Informática Gráfica

Cheat sheet Informática Gráfica

Uso del modo inmediato con Begin y End

glBegin(tipo_primitiva) // tipo_primitiva puede ser GL_TRIANGLES, GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP
    // Escribir sucesión de atributos del vértice + vértice. Ejemplo:
    glColor3f(r1, g1, b1); glNormal(xn1, yn1, zn1); glTexCoord2f(u1, v1); glVertex3f(x1, y1, z1);
    // glColor3f(), glNormal(), glTexCoord2f() pueden ser omitidos.
        ...
@Asmilex
Asmilex / Cuadraticas.ipynb
Last active January 9, 2021 11:42
Calculadora para ecuaciones cúbicas y cuárticas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.