Skip to content

Instantly share code, notes, and snippets.

function forEachFrame (fn, targetWindow = window, filter = () => null) {
const frames = targetWindow.document.querySelectorAll('iframe, frame');
for (const frame of frames) {
if (filter(frame)) {
continue;
}
try {
fn(frame.contentWindow, frame);

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

<script>
(function (apiKey) {
(function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=[];
v=['initialize','identify','updateOptions','pageLoad'];for(w=0,x=v.length;w<x;++w)(function(m){
o[m]=o[m]||function(){o._q[m===v[0]?'unshift':'push']([m].concat([].slice.call(arguments,0)));};})(v[w]);
y=e.createElement(n);y.async=!0;y.src='https://cdn.pendo.io/agent/static/'+apiKey+'/pendo.js';
z=e.getElementsByTagName(n)[0];z.parentNode.insertBefore(y,z);})(window,document,'script','pendo');
if (Auth.isLoggedIn(user) && Account.isLoaded(user.account)) {
[
{
"from": "^https?://[\\w-]*pendo-[\\w]+.appspot.com/dist/js/(app|libs).(min|full).js",
"to": "https://local.pendo.io:3000/dist/js/$1.full.js",
"isActive": true,
"isRegex": true
},
{
"from": "^https?://[^/]+/agent/static/[0-9a-zA-Z\\-_]+/pendo(-staging)?.js",
"to": "https://local.pendo.io:8081/dist/pendo.jsonp.js",
@media screen and (max-width: 767px) {
table.table-magic {
border: 0;
}
table.table-magic thead {
display: none;
}
table.table-magic tr {
margin-bottom: 10px;
display: block;
0 info it worked if it ends with ok
1 verbose cli [ '/Users/brianruddy/.nvm/versions/node/v6.10.3/bin/node',
1 verbose cli '/Users/brianruddy/.nvm/versions/node/v6.10.3/bin/npm',
1 verbose cli 'shrinkwrap',
1 verbose cli '--production' ]
2 info using [email protected]
3 info using [email protected]
4 info lifecycle [email protected]~preshrinkwrap: [email protected]
5 silly lifecycle [email protected]~preshrinkwrap: no script for preshrinkwrap, continuing
6 warn shrinkwrap Excluding devDependency: /accepts
const rows = document.querySelectorAll('.ui-grid-row');
for (let i = 0; i < rows.length; i++) {
const zIndex = rows.length - i;
const row = rows[i]
row.style.zIndex = zIndex;
row.style.position = 'relative';
}

how to review code good and do other stuff good too

  • A quick glance at the diff to spot anything obvious
  • Pull it down and run it locally with a fresh install of all dependencies
    • open the console and watch for errors being logged
    • does this patch cover the AC in the story?
    • does this patch resolve repro steps in the bug/defect?
  • Comb through code line by line:
    • Are there sanity checks in place (no infinite loops/recursion, etc)?
    • If there's complex or hard to follow code, can it be simplified?
This is how I'd set up a brand new macbook, I'll try to note what's required and what's optional
Required(ish):
Show hidden files (dotfiles) - http://www.macworld.co.uk/how-to/mac-software/how-show-hidden-files-in-mac-os-x-finder-funter-macos-sierra-3520878/
Install homebrew - https://brew.sh/
Install non-apple git - $ brew install git
Check to make sure you have ruby installed (ruby -v) and then run `gem install bundler` -> if you choose to install RVM, do that first
Install nvm WITH HOMEBREW - http://dev.topheman.com/install-nvm-with-homebrew-to-use-multiple-versions-of-node-and-iojs-easily/
Optional:
adns
ansible
autoconf
automake
bash-completion
cairo
cf-cli
composer
coreutils
dirmngr