• Building Glyphs with Chaikin Curves

    While playing around with Chaikin curves (which I first heard about from Ben Kovach in his talk about generative art ) I saw that using them to connect some random points on a screen made some cool-looking glyphs. A randomly generated language! Overview Chaikin curves (developed by George Chaikin in '74) create a smooth curve from a series of points by cutting the corners off of the curve. Given a set of points, we take each line segment and: Split it into three segments: the first 25% of the…
  • Building a Magic 8-Ball with React and Framer Motion

    Hey, all! Today, I wanted to make a magic 8-ball. We'll be using react , framer-motion , and styled-components . The goal is to make something this: Install dependencies If you've already got a site up and running that can use React, just add framer-motion and styled-components : If you don't have a site that's running React, I'd recommend just starting one with create-react-app : If you're going the create-react-app route, you can delete everything in the App.js file, and we'll build…
  • JSON to JSX code with Babel

    A few days ago, I went through a course with Steve Kinney on building your own language . In the course, we build a basic compiler, which takes an input string (we used a LISP-ish language with a (add 3 4 5) syntax), tokenizes it, parses the tokens into an Abstract Syntax Tree (AST), and then generates code from that tree. The steps look like: There are many other steps involved, and we built only a super simple language that can do basic computation and define variables. By no means do…
  • Hiding Unpublished Drafts with MDX on Gatsby

    I'm just getting started on a blog, and I wanted to use Gatsby for it. In reading the docs for Gatsby, I came across MDX. MDX lets you write posts in Markdown while also letting you import and use JSX. Once it's set up, I get to write my markdown, add some flair with components when needed, import other MDX files, and toss in some Javascript if I need to set any variables or do any maps. You may be thinking that sounds amazing. And you would be right. The hype definitely feels warranted…
©2020 Matthew Knudsen