Skip to content

Instantly share code, notes, and snippets.

View geotrev's full-sized avatar
🏠
Working from home

George Treviranus geotrev

🏠
Working from home
View GitHub Profile
import React from "react"
import { Helmet } from "react-helmet"
import PropTypes from "prop-types"
export default function SetMeta({ title, description }) => (
<Helmet titleTemplate="My Site | %s">
<title itemProp="name" lang="en">{title}</title>
<meta name="description" content={description} />
</Helmet>
)
import React from "react"
import { withLastLocation } from "react-router-last-location"
import PropTypes from "prop-types"
class AccessibleHeader extends React.Component {
constructor(props) {
super(props)
this.headerRef = React.createRef()
this.state = { tabIndex: null }
@geotrev
geotrev / PageHeader.js
Last active February 17, 2019 22:39
An accessible page header component for SPAs.
import React, { Component } from "react"
import { withLastLocation } from "react-router-last-location"
import PropTypes from "prop-types"
class PageHeader extends Component {
constructor(props) {
super(props)
this.headerRef = React.createRef()
}
@geotrev
geotrev / Preferences.sublime-settings
Created November 26, 2018 21:18
Sublime Settings
// Packages:
//
// - package control
// - babel
// - bracket highlighter
// - color highlighter
// - git blame
// - gitignored file exluder
// - jsprettier
// - sass
@geotrev
geotrev / lightbox.js
Created May 2, 2018 23:10
Lightbox Class
// Example:
//
// Include a link anywhere in the document:
// <a data-lightbox-button href='#' id="lightbox-1">lightbox 1</a>
//
// Then include the lightbox itself at the end of your <body> content:
// <div data-lightbox-overlay data-lightbox-1>
// <div class='lightbox-content' aria-labelledby="lightbox-heading-1" role="dialog">
// <header>
// <h2 id="lightbox-heading-1">Lightbox Heading</h2>