Skip to content

Instantly share code, notes, and snippets.

View robmclarty's full-sized avatar

Rob McLarty robmclarty

View GitHub Profile
import React, { useEffect, useRef, useState } from 'react'
import PropTypes from 'prop-types'
const RADIUS_MAX = 120
const RADIUS_MIN = 10
const isHex = (props, propName, componentName) => {
const regex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/
if (!regex.test(props[propName])) {
@robmclarty
robmclarty / disable-torstar-css-paywall
Created May 28, 2020 12:59
Disable Torstar's CSS Paywall
// 1. open your browser's dev tools
// 2. paste the following code into the console
// 3. press ENTER and read article
var paywall = document.querySelector('.basic-paywall-new');
paywall.style.display = 'none';
var paragraphs = document.querySelectorAll('.text-block-container');
paragraphs.forEach(function (p) {
p.style.display = 'block';

Keybase proof

I hereby claim:

  • I am robmclarty on github.
  • I am robmclarty (https://keybase.io/robmclarty) on keybase.
  • I have a public key whose fingerprint is 2EA1 ABED F1EA C891 EAB4 6794 798D 0048 0C19 69F0

To claim this, I am signing this object:

@robmclarty
robmclarty / alternativeES6ReactComponent.js
Last active August 29, 2015 14:24
An alternative method of defining a React component in ES6, mixing ideas from Crockford's better parts and https://gist.github.com/jquense/47bbd2613e0b03d7e51c
'use strict';
import React from 'react';
import assign from 'object-assign';
export default function Notification(props, context) {
const propTypes = {
messsage: React.PropTypes.string,
autoHide: React.PropTypes.bool,
isOpen: React.PropTypes.bool,