Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀

Jakub Hlusička Limeth

🦀
View GitHub Profile
View log_capture.rs
use obs_wrapper::obs_sys::{
log_handler_t, base_get_log_handler, base_set_log_handler, __va_list_tag,
LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUG,
};
use std::os::raw::{c_int, c_char, c_void};
use std::sync::atomic::{self, AtomicBool};
pub type RedirectLogCallback = Box<dyn Fn(c_int, *const c_char, *mut __va_list_tag)>;
#[repr(C)]
View gltf.frag
#version 450
layout(set = 0, binding = 0) uniform SceneUBO {
vec2 dimensions;
mat4 model;
mat4 view;
mat4 projection;
};
layout(set = 0, binding = 1) uniform sampler2D screen_sampler;
layout(set = 0, binding = 2) uniform sampler2D tex;
View gist:b016c1b14d51325b5eeffd9589cc7d15
pub mod error;
use std::sync::Arc;
use std::path::Path;
use std::ops::Deref;
use std::mem;
use std::marker::PhantomData;
use vulkano;
use vulkano::command_buffer::{DynamicState, AutoCommandBuffer, AutoCommandBufferBuilder};
use vulkano::device::Device;
View gist:ec03b74b7a5c38091d134338d333b4be
Verifying my Blockstack ID is secured with the address 1LCK2A4NbL3AzaYTy3YQGhtgsRnthNcs3J https://explorer.blockstack.org/address/1LCK2A4NbL3AzaYTy3YQGhtgsRnthNcs3J
View ore-gen.java
public static final int IMAGE_ZOOM = 8;
public static final int WIDTH = 64;
public static final int HEIGHT = WIDTH;
public static final double FREQUENCY = 1.0 / 4;
public static final int OCTAVES = 8;
public static void main(String[] args) throws IOException {
Path path = Paths.get("perlin.png");
BufferedImage image = new BufferedImage(WIDTH * IMAGE_ZOOM, HEIGHT * IMAGE_ZOOM, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
View perlin-bug.java
public static final int WIDTH = 128;
public static final int HEIGHT = WIDTH;
public static final double PERIOD = 1000;
public static void main(String[] args) throws IOException {
Perlin perlin = new Perlin();
Path path = Paths.get("perlin.png");
BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
View keybase.md

Keybase proof

I hereby claim:

  • I am Limeth on github.
  • I am limeth (https://keybase.io/limeth) on keybase.
  • I have a public key whose fingerprint is BB6C 6DE3 3DBA F610 D675 630F 685E B058 97A9 E395

To claim this, I am signing this object:

View determinant of a 6x6 matrix.rs
#[test]
pub fn det_6_copy_tuple() {
let tuple =
((1, 2, 3, 4, 5, 6), (7, 8, 9, 10, 11, 12),
(13, 14, 15, 16, 17, 18), (19, 20, 21, 22, 23, 24),
(25, 26, 27, 28, 29, 30), (31, 32, 33, 34, 35, 36));
{
match (&{
let ((_00, _10, _20, _30, _40, _50),
(_01, _11, _21, _31, _41, _51),
View nalgebra-test.log
$ cargo test
Compiling nalgebra v0.9.0 (file:///home/limeth/workspace/rust/nalgebra)
error[E0275]: overflow evaluating the requirement `<&_ as std::ops::Mul>::Output`
--> tests/mat.rs:865:61
|
865 | (7 , 8 , 9 )).determinant(),
| ^^^^^^^^^^^
|
= note: consider adding a `#![recursion_limit="128"]` attribute to your crate
= note: required because of the requirements on the impl of `std::ops::Mul` for `&na::Vector6<_>`
View gist:9961eba42b9d636046aaa51d7223a7cb
warning[E0122]: trait bounds are not (yet) enforced in type definitions
--> src/universe/entity/surface.rs:258:1
|
258 | pub type ReusableBlendFunction<C: Blend<Color=C> + ComponentWise> = Fn(PreAlpha<C, C::Scalar>, PreAlpha<C, C::Scalar>) -> PreAlpha<C, C::Scalar>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^