Skip to content

Instantly share code, notes, and snippets.

Avatar
👌

AlexApps99

👌
View GitHub Profile
View fxhash.rs
#[inline]
const fn add_to_hash(hash: u64, i: u64) -> u64 {
(hash.rotate_left(5) ^ i).wrapping_mul(0x517cc1b727220a95)
}
/// A const implementation of [`rustc_hash::FxHasher`]
pub const fn fxhash(v: &str) -> u64 {
let mut hash: u64 = 0;
let bytes = v.as_bytes();
let l = bytes.len();
@AlexApps99
AlexApps99 / crc64.rs
Created Aug 27, 2021
A simple const CRC64 hashing implementation in Rust
View crc64.rs
use std::hash::{Hash, Hasher};
const CRC64_ECMA182_POLY: u64 = 0x42F0E1EBA9EA3693;
const CRC64_TABLE: [u64; 256] = {
let mut crc64table = [0u64; 256];
let mut i = 0u64;
while i < 256 {
let mut crc = 0u64;
View desmos.dark.user.js
// ==UserScript==
// @name Desmos Dark Mode
// @namespace https://alexapps99.github.io/
// @version 0.3.0
// @description Improved dark mode colors for Desmos, with images and colors displayed correctly. Note: To disable dark mode being on by default, comment out line 15.
// @author AlexApps99
// @source https://gist.github.com/AlexApps99/519c7bcef683244bd944497ce96940a2
// @downloadURL https://gist.githubusercontent.com/AlexApps99/519c7bcef683244bd944497ce96940a2/raw/desmos.dark.user.js
// @match http://www.desmos.com/calculator*
// @match https://www.desmos.com/calculator*
@AlexApps99
AlexApps99 / create_rtk_deck.py
Created Dec 14, 2020
Generate an Anki deck from a PDF file of Remembering the Kanji 1, 6th edition
View create_rtk_deck.py
#!/usr/bin/env python3
# By AlexApps99
# This Python script will generate an Anki deck from a PDF file of Remembering the Kanji 1, 6th edition.
# To use it, just use the command "python3 create_rtk_deck.py RTK.pdf RTK.apkg"
# Feel free to customize/modify it however you want, public domain code.
# There is unused functionality for getting stories/text too.
# If you have any questions on how to use this feel free to contact me.
# Dependencies:
# - genanki
# - beautifulsoup4
View gltf-display.rs
Gltf {
document: Document(
Root {
accessors: [
Accessor {
buffer_view: Some(
0,
),
byte_offset: 0,
count: 4,
View GBA link cable fun.md