A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
{ | |
"maxerr" : 50, // {int} Maximum error before stopping | |
// Enforcing options | |
// http://www.jshint.com/docs/options/#enforcing-options | |
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.) | |
"camelcase" : false, // true: Identifiers must be in camelCase | |
"curly" : true, // true: Require {} for every new block or scope | |
"eqeqeq" : true, // true: Require triple equals (===) for comparison | |
"es3" : true, // true: Adhere to ECMAScript 3 specification |
/** | |
* @author Juliano Castilho <julianocomg@gmail.com> | |
*/ | |
var React = require('react'); | |
var AffixWrapper = React.createClass({ | |
/** | |
* @type {Object} | |
*/ | |
propTypes: { |
To send a request via the sandbox, you can use pm.sendRequest.
pm.test("Status code is 200", function () {
pm.sendRequest('https://postman-echo.com/get', function (err, res) {
pm.expect(err).to.not.be.ok;
pm.expect(res).to.have.property('code', 200);
pm.expect(res).to.have.property('status', 'OK');
});
});
// this is a big array of 76 items I need to split into groups of 10 | |
const hugeArray = Array.from({ length: 76 }, (_, i) => i); | |
function chunkify(array, chunkSize = 10) { | |
// make a new array | |
const chunks = Array.from( | |
// give it however many slots are needed - in our case 8 | |
// 1-7 with 10 items, and 8th slot will have 6 | |
{ length: Math.ceil(array.length / chunkSize) }, | |
// this is a map function that will fill up our slots |
/** | |
* return the mid value among x, y, and z | |
* @param x | |
* @param y | |
* @param z | |
* @param compare | |
* @returns {Promise.<*>} | |
*/ | |
async function getPivot(x, y, z, compare) { | |
if (await compare(x, y) < 0) { |
import React, { useState, useEffect } from 'react'; | |
import PropTypes from 'prop-types'; | |
function DefaultLoader() { | |
return <div>Loading data...</div>; | |
} | |
function DefaultError() { | |
return <div>Something went wrong. Try again later.</div>; | |
} |
import useNetworkStateHelper from './useNetworkStateHelper'; | |
import ErrorComponent from './Error'; | |
import LoadingComponent from './Loading'; | |
import EmptyComponent from './Empty'; | |
function MovieList({ isLoading, hasError, movies }) { | |
const { isBusy, showIfBusy } = useNetworkStateHelper({ | |
loading: isLoading, | |
error: hasError, |