Skip to content

Instantly share code, notes, and snippets.

Avatar

Gavin Sharp gavinsharp

View GitHub Profile
View Tabs.js
// Assuming:
// <Tabs>
// <Tab title="">...</Tab>
// <Tab title="">...</Tab>
// <Tab title="">...</Tab>
// </Tabs>
function Tabs({ children }) {
const tabs = React.Children.toArray(children);
View Tabsjs
// Assuming:
// <Tabs>
// <Tab title="">...</Tab>
// <Tab title="">...</Tab>
// <Tab title="">...</Tab>
// </Tabs>
function Tabs({ children }) {
const tabs = React.Children.toArray(children);
View testexamples.js
render(<Component prop={mockData} )/>
// vs.
const mockState = { 'granted,': some: nesting: needed: mockData };
renderComponentWithState(Component, mockState);
@gavinsharp
gavinsharp / gist:0948b398661673134df4256ba010a0f1
Created Jan 15, 2020
example of styling sub-component of a styled component
View gist:0948b398661673134df4256ba010a0f1
======== Modal.js
export const ModalContainer = styled.div`
...
width: ...
`
export default () => {
...
<ModalContainer>
View gist:d33c79b660c3edc23bcf8385a2665789
var ImageTextRow = function ImageTextRow(_ref) {
...
var p = _react.default.createElement("p", null, "foo");
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_style.default, {
id: _ImageTextRow.default.__hash
}, _ImageTextRow.default), _react.default.createElement("div", {
className: "jsx-".concat(_ImageTextRow.default.__hash) + " " + "pageRow group ".concat(alignClass)
}, align === 'left' ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement("div", {
className: "jsx-".concat(_ImageTextRow.default.__hash) + " " + "text"
View static.goproperly.com-20190118T111334.json
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36(KHTML, like Gecko) Chrome/71.0.3559.0 Mobile Safari/537.36","hostUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","benchmarkIndex":930},"lighthouseVersion":"3.2.0","fetchTime":"2019-01-18T16:13:34.606Z","requestedUrl":"https://static.goproperly.com/","finalUrl":"https://static.goproperly.com/","runWarnings":[],"runtimeError":{"code":"NO_ERROR","message":""},"audits":{"is-on-https":{"id":"is-on-https","title":"Uses HTTPS","description":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and man
View www.goproperly.com-20190118T113114.json
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36(KHTML, like Gecko) Chrome/71.0.3559.0 Mobile Safari/537.36","hostUserAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36","benchmarkIndex":1098},"lighthouseVersion":"3.2.0","fetchTime":"2019-01-18T16:31:14.904Z","requestedUrl":"https://www.goproperly.com/request-offer","finalUrl":"https://www.goproperly.com/request-offer","runWarnings":[],"runtimeError":{"code":"NO_ERROR","message":""},"audits":{"is-on-https":{"id":"is-on-https","title":"Uses HTTPS","description":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisi
View gist:b05fafddd1c2ad4e65424c5767bdafae
Verifying my Blockstack ID is secured with the address 1FSvww4Fa7WBjsb7gC7wjWpn8m11dhhAhx https://explorer.blockstack.org/address/1FSvww4Fa7WBjsb7gC7wjWpn8m11dhhAhx
View task.js
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80 filetype=javascript: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/**
* This module implements a subset of "Task.js" <http://taskjs.org/>.
View keybase.md

Keybase proof

I hereby claim:

  • I am gavinsharp on github.
  • I am gavinsharp (https://keybase.io/gavinsharp) on keybase.
  • I have a public key whose fingerprint is EC83 3EED 7B4C EB9A 3636 1F44 BFA6 7EC5 D098 0797

To claim this, I am signing this object:

You can’t perform that action at this time.