Skip to content

Instantly share code, notes, and snippets.

Jeffrey Gilbert jeffreytgilbert

  • Chicago, IL
Block or report user

Report or block jeffreytgilbert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jeffreytgilbert / needle-in-global-haystack.js
Created Sep 27, 2019
Find a needle in the global haystack of nested junk
View needle-in-global-haystack.js
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
View .gitconfig
[filter "media"]
clean = git-media-clean %f
smudge = git-media-smudge %f
name = Jeffrey Gilbert
email =
default = simple
excludesfile = /Users/jgilbert/.gitignore_global
View Be amazing in interviews.html
<!DOCTYPE html>
* {
font-family: Helvetica, Arial, sans-serif;
body {
font-family: Helvetica, Arial, sans-serif;
jeffreytgilbert / test-styles.css
Created Sep 8, 2014
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.
View test-styles.css
iframe {
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
jeffreytgilbert / index.html
Created Sep 8, 2014
Main document for loading throttling tests in various browsers. This document loads the other test frames in various ways where they are outside and inside the viewport, then moves them all back into the viewport once tests have completed.
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link href="test-styles.css" rel="stylesheet" type="text/css">
<body bgcolor="#eeeeff" bottommargin="0" rightmargin="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div style="float:left;position:relative; border:10px solid royalblue; width:820px; height:1100px;">
<!-- show 1 iframe and box out the other -->
jeffreytgilbert / js-test-frame.html
Created Sep 8, 2014
Framed documents which try and force redraws in the browser and then measure the rates at which they redraw to discover discrepancies in browser behavior.
View js-test-frame.html
<!DOCTYPE html>
<meta charset="utf-8">
<link href="test-styles.css" rel="stylesheet" type="text/css">
body {
jeffreytgilbert / js-perf-struct-frame.html
Created Sep 8, 2014
A container to frame content so positioning it outside of the viewport is easier.
View js-perf-struct-frame.html
<!DOCTYPE html>
<meta charset="utf-8">
<link href="test-styles.css" rel="stylesheet" type="text/css">
<body bgcolor="#FFFF99" bottommargin="0" rightmargin="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div style="position:relative; border:10px solid #228b22; width:820px; height:250px;">
<!-- first frame is positioned where it will be in view by the container iframe in the parent document -->
jeffreytgilbert /
Created Sep 8, 2014
Research notes into browser throttling behaviors


Throttling and Browser Optimization

Flash Support

It is known that certain VMs can reduce the amount of FPS allowed by Flash in order to provide a more performant experience for their users. One known software is VMWare. Because we do extensive testing using SauceLabs browser grid service through selenium webdriver, we wanted to test the compatibility with real world results on specific browsers we were seeing odd results in. Below are some of the findings from this research, which resulted in our adoption of IE11 on Windows 8 and our drop of IE optimization detection on all other Windows releases.

FPS throttle detection unsupported
View tw-auth.js
var open = require('open');
var url = require('url');
var http = require('http');
var twitterAPI = require('node-twitter-api');
var Q = require('q');
var authObject = (function () {
var deferred = Q.defer();
var twitter = {};
var token = {};
jeffreytgilbert / posers.js
Last active Aug 29, 2015
Sometimes android browsers get iphone envy and try to pretend they're mobile safari... So I broke it down by os by feature detection, because i needed to for this.
View posers.js
// see if this is a mobile browser
var w = window, d = document;
var regex = /mobi|android|webos|blackberry|ipad|ipod|iphone|tablet|phone|kindle/i; = regex.test(ua) || regex.test(w.navigator.platform);
if ( {
if ( || w.performance) { // this is an android device posing as an iPhone
if (w.Worker) { // android 4.4+
You can’t perform that action at this time.