Skip to content

Instantly share code, notes, and snippets.

View l8on's full-sized avatar

Leighton Wallace l8on

  • BioRender
  • San Francisco
View GitHub Profile
@l8on
l8on / monitoring-jank.coffee
Last active August 24, 2018 12:10
Monitoring Jank Example
# Simple function that uses a heuristic to tell if a function
# is native code. Luckily this isn't security related code.
isNative = (fn) ->
return (/\{\s*\[native code\]\s*\}/).test('' + fn)
# An easy check to ensure we are on a modern browser
isModernBrowser = ->
return (
window.addEventListener &&
window.performance?.now &&
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#00adf2",
"@brand-success": "#00c87b",
"@brand-info": "#5bc0de",