Skip to content

Instantly share code, notes, and snippets.

View BrianMitchL's full-sized avatar

Brian Mitchell BrianMitchL

View GitHub Profile
@BrianMitchL
BrianMitchL / update-cloudflare-ddns.sh
Last active March 1, 2023 06:51
A bash script to update an A record for a domain in Cloudflare to be the value of the current IP
#!/bin/bash
zone_id=
# needs DNS read and write access
api_key=
# must also be in the given zone
record_name=example.com
ip=$(curl -s -X GET https://checkip.amazonaws.com)
record_id=$(curl -X GET "https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records?type=A&name=$record_name" \
@BrianMitchL
BrianMitchL / Eleventy Redirect From.md
Last active February 28, 2024 23:05
Eleventy Redirect From

Eleventy Redirect From

Use this template for drop-in replacement from the jekyll-redirect-from style of creating redirect files from old routes to the route of the current page.

In the front matter or data of a page, add one or many redirects:

Single

redirect_from: /old-url/page

Make Goofy Features

I have zero authority here, I just enjoy finding and creating these features and want to see more of them 😄

Potential Benefits:

  • Personality
  • Friendly (hopefully!)
  • Memorable
  • Can even be a reason to share your site/app/etc.
  • Learn new things when building the feature
@BrianMitchL
BrianMitchL / sneaky-css-checkbox-example.html
Last active May 25, 2020 04:33
Avoid using display: none to hide elements that need to be focused.
<style rel="stylesheet" type="text/css">
.checkbox-example button {
margin: 0 0 0.5rem;
}
.checkbox-example input {
margin: 0;
padding: 0;
cursor: pointer;
}
.checkbox-example input + label {
@BrianMitchL
BrianMitchL / react-form.d.ts
Last active October 12, 2019 18:46
Trying out using full form value and meta generics throughout, this is pretty gross
declare module 'react-form' {
import {
ChangeEventHandler,
ComponentType,
Dispatch,
FocusEventHandler,
FormEventHandler,
HTMLProps,
Provider,
SetStateAction,

Keybase proof

I hereby claim:

  • I am brianmitchl on github.
  • I am brianmitchl (https://keybase.io/brianmitchl) on keybase.
  • I have a public key ASCSBzL1sbFuWhKtYGUtAAdsRIf1K0jVV1z94qHamcHEIgo

To claim this, I am signing this object:

  • A10 Fusion SoC (the power in it is incredible)
  • 2GB of RAM
  • 3D Touch (apps and especially iOS 10 have been adding more support for it)
  • Camera
    • 12 MP (vs 8 MP)
    • ƒ/1.8 aperture (vs ƒ/2.2 on the iPhone 6)
    • Optical image stabilization
    • RAW
    • 4K video
  • Quad-LED True Tone flash