Skip to content

Instantly share code, notes, and snippets.

View designerzen's full-sized avatar

zen designerzen

View GitHub Profile
@designerzen
designerzen / inv_sqrt.c
Created September 4, 2022 20:00
Fastest inverse square root
float inv_sqrt(float x)
{ union { float f; uint32 u; } y = {x};
y.u = 0x5F1FFFF9ul - (y.u >> 1);
return 0.703952253f * y.f * (2.38924456f - x * y.f * y.f);
}
// This watches for a prop in three different ways to ensure that it eventually resolves
export const onRefAvailable = (reference, callback) => {
const hasReference = r => (r && r.value && r.value instanceof HTMLElement)
const test = (r=reference) => {
//console.error("testing for refs",r)
if ( hasReference(r) )
{
const parse = (s) => {
let r = s
let ii
let pre1 = []
let pre2 = []
// detect newline format
const newline = r.indexOf('\r\n') != -1 ? '\r\n' : r.indexOf('\n') != -1 ? '\n' : ''

Keybase proof

I hereby claim:

  • I am designerzen on github.
  • I am designerzen (https://keybase.io/designerzen) on keybase.
  • I have a public key ASCGJvRQ1F7WTSdK2xO_sOzgoZvFRZiACmCS4o0UWJ7THQo

To claim this, I am signing this object:

@designerzen
designerzen / Responsive Columns
Created May 14, 2015 21:36
Responsive Columns
article{
-moz-column-count: 1;
-webkit-column-count: 1;
column-count: 1;
-moz-column-rule: 1px solid #c4c8cc;
-webkit-column-rule: 1px solid #c4c8cc;
column-rule: 1px solid #c4c8cc;
-moz-column-gap: 12px;