Skip to content

Instantly share code, notes, and snippets.

View chroot.sh
#!/bin/bash
set -e
# this is mostly copied from arch-chroot
BASE="$(realpath $(dirname "$0"))"
LFS="$BASE/root"
die() {
printf "ERROR: "
View main.rs
#![no_std]
#![no_main]
use panic_halt as _;
use stm32f1xx_hal::{pac, prelude::*, rcc, usb};
use usb_device::prelude::*;
use usbd_serial::{SerialPort, USB_CLASS_CDC};
#[cortex_m_rt::entry]
View kitchensink.txt
Bluegrass Kitchen Sink
Run `help` to list commands.
> help
Main
====
help show this help text
test run the built-in test
EEMBC CoreMark
View table.c
/* calibration table generated 2022-03-21T15:12:26.123655
table represented within tolerance 0.1% by 46 points
capacity: 12.57 Ah
138.89 Wh
100% | ~~~~~
| ~~
| ~
View main.rs
// find the segmented address of STAGE3_ENTRY
// be careful: rust *really* wants to optimize STAGE3_ENTRY into a u16
// in the resulting binary
let mut buf_address: u32;
unsafe {
core::arch::asm!(
"mov {1}, {0}",
in(reg) STAGE3_ENTRY,
out(reg) buf_address,
);
View main.rs
#![no_std]
#![no_main]
#![feature(asm_sym)]
#![feature(naked_functions)]
use blue_loader_stage3::{realmode, realmode_asm};
extern "sysv64" {
static REALMODE_IMAGE: &'static [u8];
static mut REALMODE: &'static mut [u8];
@agrif
agrif / lib.rs
Created November 18, 2021 00:24
View lib.rs
use angle::Rad;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
macro_rules! log {
( $( $t:tt )* ) => {
web_sys::console::log_1(&format!( $( $t )* ).into());
}
}
View lite3dp-convert.py
#!/usr/bin/env python3
import argparse
import io
import os.path
import shutil
import zipfile
from PIL import Image
View example.py
import carbide
import numpy as np
s = carbide.scene.Scene()
s.camera.resolution.modify(1920, 1080)
s.renderer.spp = 64
s.renderer.spp_step = 4
for _ in range(100):
c = carbide.scene.Cube()
View example.py
import carbide
import numpy as np
s = carbide.scene.Scene()
s.camera.resolution.modify(1920, 1080)
s.renderer.spp = 64
a = carbide.scene.Sphere()
a.translate(-2, 0, 5)
a.emission = carbide.scene.ConstantTexture.grey(2.0)