Skip to content

Instantly share code, notes, and snippets.

View xsduan's full-sized avatar
💭
help

Shane Duan xsduan

💭
help
  • JPMorgan Chase & Co
  • Chicago, IL
  • 18:22 (UTC -05:00)
View GitHub Profile
@xsduan
xsduan / unity3d-edge-headers.js
Created January 20, 2021 07:00
Unity3D compressed WebGL CloudFront mappings
/**
* So this simulates the header mapping rules for CloudFront that compressed
* Unity3D builds need when hosted on S3, since number one it doesn't compress
* anything bigger than 10M and number two it doesn't mark already compressed
* files as compressed because it doesn't know what ".gz" is.
*
* It's super annoying but hey, what are you gonna do.
*
* https://docs.unity3d.com/2020.1/Documentation/Manual/webgl-server-configuration-code-samples.html
*
@xsduan
xsduan / challenge.bf
Last active November 11, 2020 06:33
image-parser-challenge
set height to 1 because duh
>>>>>>>>>>>>>>>>>>>>>>>+
set size to h7a to make room for the header
<<<<<<<<
++++++++++++++++
++++++++++++++++
++++++++++++++++
++++++++++++++++
++++++++++++++++
#include <iostream>
#include <utility>
// ----- prelude -----
// --- control flow ---
// ~~ if ~~
// control flow
template <bool cond, typename then_res, typename else_res> struct __if;
@xsduan
xsduan / async_sqlite.py
Last active April 3, 2024 17:27
peewee-async sqlite connection doohicky
"""
Temporary module to allow for sqlite databases during development. Remove once
we get an actual database.
"""
import peewee
from peewee_async import AsyncDatabase
import playhouse.sqlite_ext as sqlite_ext
try:
import aiosqlite
@xsduan
xsduan / apie.txt
Created December 9, 2018 06:29
ASCII PIE notation
V = a, e, i, o, u
C = b, d, g
K = g, k
L = l, m, n, r
H = x1…x5, x@, xx = h₁, h₂, h₃, h₄, h₅, hₐ, hₓ
K' – ǵ, ḱ
Kv – gʷ, kʷ
gvh – gʷʰ