Return to CodeGregg#TinyWins!
This is a little microsite for recording small personal wins of mine and also small learnings in web development as I go. Almost like a blog but smaller :)
Union of all types in another type. Typescript
If you want the union type of all the types of the values in another type in typescript you can use the keyof operator.09 December, 2022
Git hard reset to origin for current branch
If you have force pushed changes to a git branch on the remote and want
to pull that branch into your local you can do it in two commands…07 June, 2022
Regex find and replace for VSCode
The other day I learned a neat trick. Note this will work in many other editors as well.
I needed to remove the type case at the end of an…16 April, 2022
Open Graph As A Service
The other day I was looking through a repo and stumbled across someone using
Vercel's open graph image generator ( https://og-image.vercel…13 February, 2022
JS Add Leading 0 to Single Digit Numbers
Sometimes you have single digit numbers that your want to add a leading 0 to for whatever reason.
For example if you're dealing with dates…01 January, 2022
Window Balancers
This last weekend I learned how window balancers work. My windows are Anderson
brand but I think it's similar for most other windows. The…17 May, 2021
Destructure Optional Params in Typescript
I was gonna write this here but then just made a blog post,06 May, 2021
How To See All Participante In Google Meet
Recently learned you can view up to 49 people silmultaneously in Google Meet.
Click the three dots in the bottom right corner and click…03 May, 2021
M1 Mac Puppeteer Issues
I was having issues running Puppeteer on my new M1 Apple Mac. Turns out I was
using an old version of Node and Puppeteer. Upgrading to Node…03 May, 2021
Obsidian Checkboxes Keyboard Shortcut
If you're using Obsidian for editing markdown files there's a sweet keyboard
shortcut for checking checkboxes in the edit mode. You can also…30 April, 2021
node-sass Is Dead
So the other day I was updating my personal site to Node v16 and I noticed I
couldn't install node-sass. I thought it was an m1 issue so was…30 April, 2021
Array Destructuring
Learned today that you can skip items when destructuring an array by using
commas and leaving the index you want to skip over blank. This…18 April, 2021
Remove Plus Email with Regex
Sometimes you want to strip off gmail + additions from an email. You probably
don't want to store it this way because people should…24 March, 2021
Upgraded Gatsby V3
I upgraded Gatsby to V3 on my personal site and am now using the new
gatsby-image-plugin. Upgrade wasn't too bad 😃 took maybe an hour total…20 March, 2021
I Fucking Love Css Grid
I love that instead of doing this: I can just do this:12 March, 2021
How to deal with Date Types in NextJS getStaticProps
If you're using NextJS you're probably using the getStaticProps function or the
getServerSideProps function on your pages to fetch data to…19 January, 2021
Postgres Hosted
Learned that finding a simple (~free) Postgres hosted solution is kinda hard.
Heroku kinda works but for a Vercel-hosted NextJS app it was…13 January, 2021
Webmentions
Added webmention counts to my blog posts and tiny wins.27 May, 2020
:before Element On Top of Background but Behind Text
Sometimes you have content in a before element that you want to appear on top of
a background image but behind other elements on the page…10 May, 2020
Netlify Redirects With Gatsby
Was having troubles with my functions redirect rule in netlify.toml file with my
Gatsby site. Originally it looked like this: But gatsby was…08 May, 2020
Gatsby Social Cards
Spent the all of today creating social cards that are generated at build time
for my Gatsby blog. Most of my frustration came with trying to…05 May, 2020
Emotion Partials
Learned how to add partials to emotion styled components with props. This way
you can add a bunch of css if a prop is true. Boy is React…27 April, 2020
React Gauge with Emotion Props
Made an awesome React SVG circle gauge with emotion props.26 April, 2020
Laravel
Just got my old wedding website up at http://gregg-wedding.herokuapp.com/ . I
forgot how easy Laravel is to use. Especially making models…16 April, 2020
Tiny Win Code Snippet
Wrote an awesome VS Code snippet for starting new tiny win files in mdx. This
snippet takes the filename and capitalizes words as well as…10 April, 2020
Django Search
Implemented basic search in django using SearchFilter. You can add something
this simple to a ViewSet to make fields searchable the search…10 April, 2020
Bone Marrow Biopsy
Successfully made it through my third bone marrow biopsy. It's painful and weird
but thankfully not too painful. I just have such an…13 January, 2020
Backend
I found a hidden issue in a python API. My backend dev for this project has been
on PTO lately so I've had to take over for him. I feel…19 December, 2019
Memcache
So I might not know all the depths of how caching works... who does? But I did
figure out how to run cron jobs, edit entities, and flush…18 December, 2019
Github Actions
I made my first Github action to deploy a static VueJS site to Firebase hosting.11 December, 2019
Django Site Url
I solved a nasty bug in django I was having with getting the site_url for
transactional email. I didn't realize this site_url came from the…21 November, 2019
Segmented MDX in GraphQL
I learned how to split different filesystem sources in gatsby and use childMdx
to get the transformed mdx child node.18 November, 2019
Puppeteer Allergies
Built a puppeteer scraper for allergy data. Transformed it into a serverless function that proxies the request.18 September, 2019
First Open Source PR
Got my first public PR approved and merged05 September, 2019
Beingful
Got invited to consult with a startup called Beingful by one of their board
members. Accepted VP of Tech role.01 September, 2019
Gatsby Theme
Shipped my first piece of open source software, a Gatsby theme31 July, 2019