Discover gists
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
type PickProp<T, K> = K extends keyof NonNullable<T> | |
? T extends undefined | |
? NonNullable<T>[K] | undefined | |
: NonNullable<T>[K] | |
: undefined; | |
export function focusPropAtom<Store, Result, Key extends keyof NonNullable<Store>>( | |
baseAtom: WritableAtom<Store, [SetStateAction<Store>], Result>, | |
path: Key, | |
) { |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
function obj2str(obj) { | |
var fString = function(objj) { | |
if (!objj) return objj; | |
var newObj = Array.isArray(objj) ? [] : {} | |
Object.keys(objj).map(function(k) { | |
if (typeof(objj[k]) == "function") newObj[k] = objj[k].toString(); | |
else if (typeof(objj[k]) == "object") newObj[k] = fString(objj[k]); | |
else newObj[k] = objj[k]; | |
}) | |
return newObj; |
/* | |
* Stripe WebGl Gradient Animation by Stripe.com | |
* ScrollObserver functionality to disable animation when not scrolled into view has been disabled and | |
* commented out for now. | |
* | |
* Taken from: https://kevinhufnagl.com/how-to-stripe-website-gradient-effect/ | |
* See also: https://codepen.io/smitpatelx/pen/GRZayyO | |
*/ | |
// Converting colors to proper format |
// Based on Dean McNamee's OBJ loader | |
// Modified to output triangles with texture coords | |
function loadOBJ(filename){ | |
var filedata = fs.readFileSync(filename, 'utf8'); | |
var lines = filedata.split('\n'); | |
var tris = [ ]; | |
var v = [ null, ]; // Verts, indexed from 1, so put in a filler. |
So I have spent my last 4 days to try get proxmox working with an nginx proxy. Due to how proxmox is built up I had to get clever with some rewrite, break some nginx rules and spend sleepless nights awake to try figure this out (to be honest I am no genius on web servers as I rarely have to touch them). Plus it seems like nobody (from my googling) had managed to set proxmox up to work behind a proxied subdir, understandably so as some of the html generated uses absolute paths for sources instead of relative paths and you need to deal with that.
This is the proxmox.conf file i ended up making (Replace all instances of pve.local:8006 with your internal proxmox ip and port) And replace publicwebsite.com with your website domain
NOTE: THIS IS FOR PVE6 and I have no plans to fix for PVE7 as I do not need it behind a reverse proxy anymore.
if (typeof Object.create !== 'function') { | |
Object.create = function(o) { | |
function F() {}; | |
f.prototype = o; | |
return new F(); | |
}; | |
} |