Skip to content

Instantly share code, notes, and snippets.

@noahehall
noahehall / jq-cheetsheet.md
Created January 4, 2023 03:27 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@noahehall
noahehall / convert_hcl_vault_policy_to_json.sh
Created December 24, 2022 22:53 — forked from v6/convert_hcl_vault_policy_to_json.sh
// , convert_hcl_vault_policy_to_json.sh converts a Vault Policy in HashiCorp Language format to the Single line JSON format.
#!/usr/bin/env bash
## tr -d '\n' |
##
## Behold.
##
## ______ _____ _ _ _____ _ ______
## | ___ \ ___| | | | _ | | | _ \
## | |_/ / |__ | |_| | | | | | | | | |
## | ___ \ __|| _ | | | | | | | | |
## | |_/ / |___| | | \ \_/ / |___| |/ /
@noahehall
noahehall / mrdoobstats.js
Created April 26, 2017 05:10
mr doob stats fixed to bottom of screen
// stats.js - http://github.com/mrdoob/stats.js
(function(f,e){"object"===typeof exports&&"undefined"!==typeof module?module.exports=e():"function"===typeof define&&define.amd?define(e):f.Stats=e()})(this,function(){var f=function(){function e(a){c.appendChild(a.dom);return a}function u(a){for(var d=0;d<c.children.length;d++)c.children[d].style.display=d===a?"block":"none";l=a}var l=0,c=document.createElement("div");c.style.cssText="position:fixed;bottom:0;left:0;cursor:pointer;opacity:0.9;z-index:10000";c.addEventListener("click",function(a){a.preventDefault();
u(++l%c.children.length)},!1);var k=(performance||Date).now(),g=k,a=0,r=e(new f.Panel("FPS","#0ff","#002")),h=e(new f.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var t=e(new f.Panel("MB","#f08","#201"));u(0);return{REVISION:16,dom:c,addPanel:e,showPanel:u,begin:function(){k=(performance||Date).now()},end:function(){a++;var c=(performance||Date).now();h.update(c-k,200);if(c>g+1E3&&(r.update(1E3*a/(c-g),100),g=c,a=0,t)){var d
@noahehall
noahehall / rAF.js
Created January 25, 2017 08:51 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@noahehall
noahehall / what-forces-layout.md
Created January 25, 2017 07:51 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@noahehall
noahehall / generic-js-benchmark.html
Created January 16, 2017 01:56 — forked from mucaho/generic-js-benchmark.html
Generic template for benchmarking / performance testing JavaScript code using the [Benchmark node module](https://www.npmjs.com/package/benchmark)
<html>
<head>
<script src="https://wzrd.in/bundle/lodash@4.11"></script>
<script src="https://wzrd.in/bundle/platform@1.3"></script>
<script src="https://wzrd.in/bundle/benchmark@2.1"></script>
</head>
<body>
<script>
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
@noahehall
noahehall / .block
Created December 17, 2016 02:41 — forked from mbostock/.block
Radial Stacked Bar
license: gpl-3.0
height: 960
@noahehall
noahehall / react-formatjson.html
Created July 1, 2016 04:47 — forked from kristopherjohnson/react-formatjson.html
JSON Formatter using ReactJS
<!doctype html>
<html lang="en">
<head>
<title>JSON Formatter</title>
<script src="//fb.me/react-0.12.2.min.js"></script>
<script src="//fb.me/JSXTransformer-0.12.2.js"></script>
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Source+Code+Pro' rel='stylesheet' type='text/css'>
@noahehall
noahehall / nickname.md
Created June 26, 2016 22:11 — forked from brigand/nickname.md
Freenode Setting Up Your Nickname

What is the recommended way to set up my IRC nickname?

Please follow these steps to set up your nick and configure your client. Check off each step to make sure it's been done:

Select a permanent, master nickname. If the nickname you want is registered but has expired, just ask a staffer and in most cases, we will be happy to drop it for you.

Please avoid using the name of a community project or trademarked entity, to avoid conflicts. Write down your password and be sure to keep the sheet of paper in a safe place.

Register your IRC nick:

@noahehall
noahehall / .eslintrc.js
Created June 22, 2016 21:44 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {