Skip to content

Instantly share code, notes, and snippets.

View gxtaillon's full-sized avatar

Guillaume Xavier Taillon gxtaillon

View GitHub Profile
@gxtaillon
gxtaillon / main.rs
Created January 15, 2023 20:13 — forked from jix/main.rs
Lifetime GAT emulation on stable rust
// This is a technique to emulate lifetime GATs (generic associated types) on stable rust starting
// with rustc 1.33.
//
// I haven't seen this exact technique before, but I would be surprised if no one else came up with
// it. I think this avoids most downsides of other lifetime GAT workarounds I've seen.
//
// In particular, neither implementing nor using traits with emulated lifetime GATs requires adding
// any helper items. Only defining the trait requires a single helper trait (+ a single helper impl
// for the 2nd variant) per GAT. This also makes the technique viable without any boilerplate
// reducing macros.
#source $ACTIVATE_PATH
from django.contrib.auth.hashers import make_password
from django.conf import settings
settings.configure()
make_password("secret")
# author: tmwhere.com
# --- third party dependencies
PIXI = require('pixi.dev')
_ = require('lodash')
noise = require('perlin').noise
Quadtree = require('quadtree').Quadtree
seedrandom = require('seedrandom')
# ---
@gxtaillon
gxtaillon / MDC Fix
Last active August 29, 2015 14:09
Mouse double clicking problem autohotkey fix
LButton::
Click down left
KeyWait, LButton
KeyWait, LButton
Click up left