Skip to content

Instantly share code, notes, and snippets.

View Nyrox's full-sized avatar
🏃‍♀️
coding fast boii

Mark-Oliver Junge Nyrox

🏃‍♀️
coding fast boii
View GitHub Profile
use std::fmt::Debug;
/// # Partial Result
///
/// Result type for operations which can fail, but still return some data
///
/// Conceptionally, this is a (D, Option<E>)
///
/// The design of this type is intended to force handling of errors, but also
/// grant access to partial results in case of errors
Copper Plate, 1024
Aluminium Plate, 1024
function automate(selector, interval) {
let id;
let on = () => {
if (id) {
console.log(selector + " already automated")
return;
}
// old version
customElements.define("monaco-editor", class extends HTMLElement {
constructor() {
super();
this._editorValue = "loading..."
}
set _editorValue(value) {
module ContextMenu
open Fable
open Fable.Core
open Utils
open Fable.React
open Elmish
open Elmish.React
open Fable.React.Props
open Fable.React.HookBindings
let DirEntry =
React.FunctionComponent.Of
((fun name ->
let hidden = Hooks.useState false
let img =
img [ Src <| Utils.getStatic "icons/directory.svg" ]
let mutable className = "directory"
if hidden.current then className <- className + " hidden"
using Makie
using AbstractPlotting
scene = Scene()
scene = mesh(Sphere(Point3f0(0), 0.9f0), transparency=true, alpha=0.05)
function cosine_weighted_sample_hemisphere()
r1 = rand()
vec3 sundir;
vec3 I_R, I_M;
vec2 totalDepthRM;
// consts
const vec3 rayScatterCoeff = vec3(58e-7, 135e-7, 331e-7);
const vec3 rayEffectiveCoeff = rayScatterCoeff; // Rayleight doesn't absorb light
const vec3 mieScatterCoeff = vec3(2e-5);
Constant buffer:
[6, 20, 20, 12, 0, 2, 0]
Variable Slots:
{}
Instruction block:
main
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const main = {
entry: ['./source/main.js', './assets/styles/main.scss'],
output: {
filename: "main.js",
path: path.resolve(__dirname, "dist")
},
resolve: {