Skip to content

Instantly share code, notes, and snippets.

View davnicwil's full-sized avatar

David Nicholas Williams davnicwil

View GitHub Profile
@davnicwil
davnicwil / benchmark.sh
Last active December 28, 2022 22:24
Rough CPU benchmark
start=`date +%s`;num=0;for ((n=0;n<100000000;n++));do num=$(($num+(1 + $RANDOM % 10)));done; end=`date +%s`;runtime=$(($end-$start));echo "result is $num, took $runtime seconds";
@davnicwil
davnicwil / GridEmptySpace.tsx
Last active June 19, 2019 00:52
material-ui Grid empty space component
import React from 'react'
import styled from 'styled-components'
import { withTheme } from '@material-ui/core'
import Grid from '@material-ui/core/Grid'
const HIDDEN = 'hidden'
const GridSupportingHidingAtSpecifiedBreakpoints = styled(Grid)`
@media (min-width: ${(p) => p.theme.breakpoints.values.xs}px) {
display: ${(p: any) => (p.xs === HIDDEN ? 'none' : 'flex')};

Keybase proof

I hereby claim:

  • I am davnicwil on github.
  • I am davnicwil (https://keybase.io/davnicwil) on keybase.
  • I have a public key ASBtg86qu3rr_14qWlEQjyHZU9I59g3D_8Jc5-ZtQ4uVQQo

To claim this, I am signing this object: