Skip to content

Instantly share code, notes, and snippets.

View jeffreytgilbert's full-sized avatar

Jeffrey Gilbert jeffreytgilbert

View GitHub Profile
@jeffreytgilbert
jeffreytgilbert / test-styles.css
Created September 8, 2014 20:32
Simple css file for zeroing out borders, padding, and margins on iframes and soon to include css animations for other tests where detecting keyframe progression may be possible.
iframe {
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
}
<!DOCTYPE html>
<html>
<head>
<style>
<!--
* {
font-family: Helvetica, Arial, sans-serif;
}
body {
font-family: Helvetica, Arial, sans-serif;
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
[user]
name = Jeffrey Gilbert
email = [email protected]
[push]
default = simple
[core]
excludesfile = /Users/jgilbert/.gitignore_global
@jeffreytgilbert
jeffreytgilbert / needle-in-global-haystack.js
Created September 27, 2019 19:29
Find a needle in the global haystack of nested junk
const findNeedleInHaystack = (needle, haystack) => {
let reference = [];
let promises = [];
const finder = (obj, chain) => {
return new Promise((resolve, reject)=>{
if (reference.includes(obj)) {
return resolve(chain.join('.')); // already checked this object
}
// add object as "checked" to reference registry
reference.push(obj);
@jeffreytgilbert
jeffreytgilbert / resolveApi.tsx
Created April 20, 2024 00:25
The wrong way?
import { useAuth } from "../auth/hooks/useAuth";
enum XHRFailureCodes {
AUTHENTICATION_REQUIRED = 'AUTHENTICATION_REQUIRED',
UNAUTHORIZED_ACTION = 'UNAUTHORIZED_ACTION',
FORM_VALIDATION_FAILED = 'FORM_VALIDATION_FAILED',
MISSING_REQUIRED_PARAMETERS = 'MISSING_REQUIRED_PARAMETERS',
NO_RESULTS_FOUND = 'NO_RESULTS_FOUND',
RATE_LIMIT_EXCEEDED = 'RATE_LIMIT_EXCEEDED',
UNKNOWN_ERROR = 'UNKNOWN_ERROR',