Skip to content

Instantly share code, notes, and snippets.

View realmayus's full-sized avatar

Marius realmayus

View GitHub Profile
@import "../../assets/main"
$menubarHeight: 60px
.bar
z-index: 10
width: 100%
height: $menubarHeight
background-color: #000000
position: sticky
@realmayus
realmayus / kanji.json
Last active November 20, 2021 13:09
WaniKani Kanji and Vocabulary data - There are two files, one for kanji and one for vocab words.
{
"1": [
"\u4e00",
"\u4e03",
"\u4e09",
"\u4e0a",
"\u4e0b",
"\u4e5d",
"\u4e8c",
"\u4eba",
@realmayus
realmayus / ardu.ino
Created April 8, 2023 10:34
ESP8266 + DHT22 temp + humid sensor with web GUI
// Load Wi-Fi library
#include <ESP8266WiFi.h>
#include <Adafruit_Sensor.h>
#include "DHT.h"
#include <stdio.h>
// Replace with your network credentials
const char* ssid = "SSID";
const char* password = "PASSWORD";
@realmayus
realmayus / README.md
Last active April 10, 2023 18:22
.ics date offset program

Invoke with:

python main.py calendar.ics 2 0 0

`python

@realmayus
realmayus / inputValidator.ts
Created May 18, 2023 12:43
A handy function that allows you to easily validate user input and generate a response with minimal code in the actual endpoints.
export const checkInput = (input: any, requiredKeys: string[], validator: {[key: string]: (arg0: any) => boolean | string | Response}): Response | true => {
for (const key of requiredKeys) {
if (!(key in input) || input[key] == null ) {
return new Response(JSON.stringify({error: `${key}-not-specified`}), {status: 400});
}
if (key in validator) {
const res = validator[key](input[key]);
if (typeof res === "string") {
return new Response(JSON.stringify({error: `${key}-${res}`}), {status: 400});
} else if (typeof res === "boolean" && !res) {
@realmayus
realmayus / egui.rs
Last active April 5, 2024 23:10
Basic vulkan egui integration using bindless textures and direct buffer addressing
use crate::pipeline::PipelineBuilder;
use crate::resources::{AllocUsage, AllocatedBuffer, Allocator, Texture, TextureId, TextureManager};
use crate::util::{load_shader_module, DeletionQueue};
use crate::{SubmitContext, FRAME_OVERLAP};
use ash::{vk, Device};
use bytemuck::{Pod, Zeroable};
use egui::ahash::{HashMap, HashMapExt};
use egui::epaint::{ImageDelta, Primitive};
use egui::{Context, FullOutput, ImageData, TexturesDelta};
use glam::{Vec3};