Skip to content

Instantly share code, notes, and snippets.

View YakoYakoYokuYoku's full-sized avatar
🏠
Programming from home

Martin Rodriguez Reboredo YakoYakoYokuYoku

🏠
Programming from home
  • The Planet Earth
View GitHub Profile
Computer Information:
Manufacturer: Micro-Star International Co., Ltd.
Model: X470 GAMING PLUS (MS-7B79)
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 7 2700 Eight-Core Processor
CPU Family: 0x17
@YakoYakoYokuYoku
YakoYakoYokuYoku / opengl_emscripten_example.cpp
Last active March 20, 2020 20:18
An OpenGL example with support for Linux/Unix/BSD and Emscripten.
/*
Build instructions:
To compile and run the application with G++ or Clang++ use:
$ CXX -o application.o -c opengl_emscripten_example.cpp
$ CXX -o application application.o -lGLEW -lGLU -lGL -lglfw
$ ./application
To compile and with Emscripten use:
$ em++ -o application.o -c opengl_emscripten_example.cpp -s MAX_WEBGL_VERSION=2
@YakoYakoYokuYoku
YakoYakoYokuYoku / Cargo.toml
Last active January 24, 2020 20:20
Call Rust from C#
// Cargo.toml
[package]
name = "c-abi-to-rust"
version = "0.1.0"
authors = ["YakoYakoYokuYoku <gc1000ll@gmail.com>"]
edition = "2018"
[lib]
name = "ttaone"
crate-type = ["cdylib"]
@YakoYakoYokuYoku
YakoYakoYokuYoku / mingw-solus.sh
Created September 25, 2019 22:32
A shell script for building MinGW-w64 in Solus
# Pretty neaty mingw-w64 shell script for Solus
# It works in other Linux distros (?)
# Set envars
DEST=/opt/mingw-solus # You can change it to whatever you want
TARGET=x86_64-w64-mingw32
PREFIX=$DEST/$TARGET
PCS=`nproc`
# Make the sys-root and build directories
@YakoYakoYokuYoku
YakoYakoYokuYoku / midpoint_circle.rs
Last active July 21, 2019 20:04
Midpoint circle algorithm implemented in Rust
fn drawcircle(canvas: &mut Canvas<Window>, p: &mut Coordinate<i16>, r: f64, color: Color) {
let mut x = r - 1;
let mut y = 0;
let px = p.x as i16;
let py = p.y as i16;
let mut dx = 1;
let mut dy = 1;
let mut err = dx - (r << 1);
while x >= y {