Skip to content

Instantly share code, notes, and snippets.

View HiImJulien's full-sized avatar
🏠
Working from home

Julian Kirsch HiImJulien

🏠
Working from home
View GitHub Profile
@ImTheSquid
ImTheSquid / helper.rs
Created February 20, 2023 16:17
Option<chrono::DateTime<Utc>> to Option<bson::DateTime> serialization and deserialization
pub mod chrono_datetime_option_as_bson_datetime_option {
use bson::{Bson, DateTime};
use chrono::Utc;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::result::Result;
use serde::de::Error;
pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<chrono::DateTime<Utc>>, D::Error>
where
D: Deserializer<'de>,
@K4zoku
K4zoku / dotfiles.md
Last active January 17, 2022 06:04
dotfiles for my Handmade Arch Linux sticker

Dotfiles

@williamdes
williamdes / ACME-SH-docker-compose.md
Last active January 4, 2024 10:51 — forked from Dreamacro/ACMESH.md
acme.sh using docker-compose

How to use

$ docker compose -f acmesh.yaml up -d

.env

ACME_HOME_DIR=./acme.sh
// Draft for low-level macro-less API
//
// The goal of this draft is to explore a full-featured minimal API that does not rely on macro's. That should make it easier to port
// flecs to other languages, and allow for more straightforward integration with other frameworks / engines. This is not meant as a
// full replacement for an application-facing API, though should be able to coexist with one.
//
// Inspiration for naming conventions & declarative design comes from Sokol Gfx
// Create world as usual
ecs_world_t *world = ecs_init();
@floooh
floooh / sokol_gfx_api.txt
Created August 3, 2020 15:50
sokol_gfx.h API description extracted from clang ast-dump
STRUCT sg_buffer:
uint32_t id
TYPEDEF sg_buffer = struct sg_buffer
STRUCT sg_image:
uint32_t id
TYPEDEF sg_image = struct sg_image
@BretFisher
BretFisher / .zshrc
Created July 4, 2018 20:52
my custom oh-my-zsh setup
# this assumes your using oh-my-zsh for maximum zsh-ness
# info and defaults are here:
# https://github.com/robbyrussell/oh-my-zsh/blob/master/templates/zshrc.zsh-template
export LC_ALL="en_US.UTF-8"
export ZSH=/Users/bret/.oh-my-zsh
# custom prompt theme
ZSH_THEME="present" # mine is present, default is robbyrussell, also agnoster, fishy, ys, wild-cherry
COMPLETION_WAITING_DOTS="true"
@mattatz
mattatz / Matrix.hlsl
Last active May 10, 2024 04:39
Matrix operations for HLSL
#ifndef __MATRIX_INCLUDED__
#define __MATRIX_INCLUDED__
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
float4x4 inverse(float4x4 m) {
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0];
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1];
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2];
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3];
@rickyzhang82
rickyzhang82 / keycode.linux
Created September 15, 2017 22:11
Key code for Linux
# /usr/share/BasiliskII/keycodes
#
# Basilisk II (C) 1997-2005 Christian Bauer
#
# This file is used to translate the (server-specific) scancodes to
# Mac keycodes depending on the window server being used.
#
# The format of this file is as follows:
#
# sdl <driver string>
@baines
baines / xkeyexample.c
Last active September 19, 2023 20:53
simple xlib key example
#include <stdio.h>
#include <locale.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
int main(void){
setlocale(LC_ALL, "");
Display* dpy = XOpenDisplay(NULL);
@pylover
pylover / inspections.txt
Last active April 22, 2024 07:47 — forked from ar45/inspections.txt
PyCharm inspections
# Extracted using: $ unzip -p lib/pycharm.jar com/jetbrains/python/PyBundle.properties | grep -B1 INSP.NAME | grep '^#' | sed 's|Inspection||g' | sed -e 's|#\s\{,1\}|# noinspection |'
# noinspection PyPep8
# noinspection PyPep8Naming
# noinspection PyTypeChecker
# noinspection PyAbstractClass
# noinspection PyArgumentEqualDefault
# noinspection PyArgumentList
# noinspection PyAssignmentToLoopOrWithParameter
# noinspection PyAttributeOutsideInit