Skip to content

Instantly share code, notes, and snippets.

View mik30s's full-sized avatar
😐
500 lines of template errors

Michael mik30s

😐
500 lines of template errors
View GitHub Profile
@mik30s
mik30s / variant.cc
Created October 16, 2022 17:24 — forked from tibordp/variant.cc
A simple variant type implementation in C++
#include <iostream>
#include <utility>
#include <typeinfo>
#include <type_traits>
#include <string>
template <size_t arg1, size_t ... others>
struct static_max;
template <size_t arg>
#include <AppCore/App.h>
#include <AppCore/Window.h>
#include <AppCore/Overlay.h>
#include <AppCore/JSHelpers.h>
#include <iostream>
#include <Ultralight/Ultralight.h>
#include <spdlog/spdlog.h>
#include <SFML/Window/VideoMode.hpp>
#include "ui_def.hpp"
@mik30s
mik30s / simple_render.html
Created May 8, 2019 02:53
Simple mesh rendering with the bresenham algo
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<canvas id="canvas"></canvas>
<style>
body {
margin: 0px;
}
@mik30s
mik30s / Eigen Cheat sheet
Created April 16, 2019 03:11 — forked from gocarlos/Eigen Cheat sheet
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.
This file has been truncated, but you can view the full file.
using namespace ultralight;
static Char16 ui_string[] = {0x3c,
0x21,0x44,0x4f,0x43,0x54,0x59,0x50,0x45,0x20,0x68,0x74,0x6d,0x6c,0x3e,0xa,0x3c,0x68,0x74,0x6d,0x6c,0x20,0x6c,0x61,0x6e,0x67,0x3d,0x22,0x65,0x6e,0x22,0x3e,0xa,0x3c,0x68,0x65,0x61,0x64,0x3e,0xa,0x20,0x20,0x20,0x20,0x3c,0x6d,0x65,0x74,0x61,0x20,0x63,0x68,0x61,0x72,0x73,0x65,0x74,0x3d,0x22,0x75,0x74,0x66,0x2d,0x38,0x22,0x3e,0xa,0x20,0x20,0x20,0x20,0x3c,0x74,0x69,0x74,0x6c,0x65,0x3e,0x46,0x69,0x6c,0x74,0x6a,0x73,0x3c,0x2f,0x74,0x69,0x74,0x6c,0x65,0x3e,0xa,0x20,0x20,0x20,0x20,0x3c,0x21,0x2d,0x2d,
0x20,0x69,0x6e,0x20,0x69,0x6e,0x64,0x65,0x78,0x2e,0x68,0x74,0x6d,0x6c,0x2c,0x20,0x6f,0x72,0x20,0x68,0x6f,0x77,0x65,0x76,0x65,0x72,0x20,0x79,0x6f,0x75,0x20,0x6d,0x61,0x6e,0x61,0x67,0x65,0x20,0x79,0x6f,0x75,0x72,0x20,0x43,0x53,0x53,0x20,0x66,0x69,0x6c,0x65,0x73,0x20,0x2d,0x2d,0x3e,0xa,0x3c,0x21,0x2d,0x2d,0x20,0x3c,0x6c,0x69,0x6e,0x6b,0x20,0x68,0x72,0x65,0x66,0x3d,0x22,0x2e,0x2e,0x2f,0x6e,0x6f,0x64,0x65,0x5f,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x73,0x2f,0x6e,0x6f,0x72,
@mik30s
mik30s / autodesk_reality_api.py
Last active February 16, 2019 23:05
Autodesk reality api requests in python
import requests, json, pprint
pp = pprint.PrettyPrinter(indent=4)
AUTH_URL = 'https://developer.api.autodesk.com/authentication/v1/authenticate'
PHOTO_SCENE_URL = 'https://developer.api.autodesk.com/photo-to-3d/v1/photoscene'
PHOTO_UPLOAD_URL = 'https://developer.api.autodesk.com/photo-to-3d/v1/file'
PHOTO_PROCESSOR_URL = 'https://developer.api.autodesk.com/photo-to-3d/v1/photoscene/'
config = {}
range = 30
#l = float(prompt("Launch force: "))
M = 7.2#float(prompt("mass: "))
vso = float(prompt("initial velocity: "))
th = radians(47.3)#float(prompt("launch angle: "))
r = 0.5#float(prompt("radius of sphere: "))
eta = 0.6#float(prompt("viscosity: "))
speed = 50#int(prompt("speed: `"))
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mik30s
mik30s / lab1b.py
Created September 5, 2018 04:31
Lab 1 part b - vectors
GlowScript 2.7 VPython
baseball = sphere (pos=vector(0,0,0), radius=0.2, color=color.white)
A = arrow(pos=vector(3,-2,4), axis=vector(1,-4,2), shaftsize = 0.1, color=color.cyan)
B = arrow(pos=vector(-5,3,4), axis=vector(-7,1,2), shaftsize = 0.1, color=color.cyan)
C `= arrow(pos=vector(-1,-6,2), axis=vector(-3,-8,0), shaftsize = 0.1, color=color.cyan)
print("Magnitude of A = ", sqrt(A.pos.x**2 + A.pos.y**2 + A.pos.z**2))
print("A - 3B + 2C = ", A.pos - 3*B.pos + 2*C.pos)