Skip to content

Instantly share code, notes, and snippets.

View grovesNL's full-sized avatar

Josh Groves grovesNL

View GitHub Profile
@gkaerts
gkaerts / bindless.hlsl
Last active July 18, 2024 16:31
Vulkan and D3D12 typed bindless resources in one shader-side API
// This file should be compiled with DXC against shader model 6.6
// Change the TARGET_API define here to either D3D or VK and switch compiler output formats (DXIL or SPIR-V) to match
#define D3D 1
#define VK 2
#define TARGET_API D3D
// Begin macro magic
#if TARGET_API == D3D
// No special root signature needed!
@rkbalgi
rkbalgi / gist:183a113e946dd9f8360e774dcf17a3db
Last active March 2, 2022 19:12
JDBC_PING with keycloak and postgresql on AWS Fargate
In your effort of implementing standalone-ha with keycloak postgresql using JDBC_PING you will stumble upon many sites that define
the table structure for jgroupsping and the right one goes like this -
CREATE TABLE IF NOT EXISTS JGROUPSPING (
own_addr varchar(200) NOT NULL,
cluster_name varchar(200) NOT NULL,
ping_data BYTEA,
constraint PK_JGROUPSPING PRIMARY KEY (own_addr, cluster_name)
);
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@CMCDragonkai
CMCDragonkai / notes.md
Last active June 23, 2024 22:03
3 Address Code to SSA to Assembly Explanation (by Jason Hiebel)

Notes

It should be noted that:

  1. Basic blocks in SSA can be identified at 3 points:
  • Start of the program
  • Labels
  • Branches
  1. Basic blocks are used in optimisation.
@paniq
paniq / minmaxabssign.txt
Last active June 24, 2024 17:57
useful min/max/abs/sign identities
max(-x,-y) = -min(x,y)
min(-x,-y) = -max(x,y)
abs(x) = abs(-x)
abs(x) = max(x,-x) = -min(x,-x)
abs(x*a) = if (a >= 0) abs(x)*a
(a < 0) -abs(x)*a
// basically any commutative operation
min(x,y) + max(x,y) = x + y