Bread 🍞 January 21, 2020 CSS bread. I've been into baking bread for a while now so I made this codepen to try my hand at CSS animations and well... because I love bread.
Cross Browser Web Extensions December 13, 2019 Thanks to Mozilla's webextension-polyfill, developing cross browser web extensions has never been easier. I developed a browser extension for Chrome a few years ago which integrates with Reddit to allow you to you to convert saved posts to browser bookmarks. It's gone through a few iterations over the years as I've learned more with my most recent update adding cross browser support for Chrome and Firefox. The extension itself is pretty simple. It uses cookie based authentication to login to your Reddit account and pulls your saved data, where you can then filter by subreddit, remove duplicates, and save them to a bookmark folder of your choice. With the webextension polyfill, I was able to deploy to the same extension code to both browsers. The current iteration was built with Svelte. You can check out the chrome version here and the firefox version here. The code is hosted on Github.
Interfaces - Java C#, TypeScript & beyond July 15, 2018 Those of us familiar with object oriented programming probably have some idea of what an interface does, but there's some key differences between some languages' implementations that I wanted to dive into and find out the differences. Generally an interface represents a contract between two entities - the first is the abstract data type that will implement the interface and the second being the interface whose properties and methods the object must implement. Interfaces mostly work the same in Java and C#, where they are used as a way to achieve polymorphism. A class or another interface may implement an interface and the implementer must then implement the the interface’s properties and methods as stated above. Java and C# do things a bit differently when it comes to interface properties however. In Java you may initialize a property inside of an interface, which will be treated as final static, and access that property without implementing it in the class that implements it. In a C# interface, variables cannot be initialized, the interface only lets a class know which properties it must implement. TypeScript interfaces are a different story, while they act and may be used similarly to C# interfaces, in practice they can be used very differently. As stated above, normally an interface is used as a contract with a class which implements its methods. In C#, Java, and TypeScript you may use an interface as a type for a class that implements that interface, as well as return and parameter type checking and generic constraints. You may not however initialize an instance of a interface unless you’re programming in TypeScript. In TypeScript interfaces may be treated like a struct, something the language does not have. This treatment of interfaces allows a lot of possibilities in using them. While TypeScript has a type alias as well which can be used similarly, there are often advantages to using interfaces instead. Some of these are the ability to be used in an extends or implements clause and the ability to have multiple merged declarations, things a type alias cannot do.
Conway's Game of Life Mandala Generator June 15, 2018 Continuing off of my colorful game of life implementation below I to adapted it into a mandala generator. Taking a little inspiration from this reddit post, I thought I'd try to adapt my game of life implementation into a mandala generator. Tap to start & stop, double tap to reset
A colorful Game of Life June 10, 2018 For those unfamiliar with Conway's Game of Life, it is a zero-player "game" devised in 1970 by British mathematician John Conway. The game is carried out on a two-dimensional orthogonal grid of square "cells", each of which in one of two possible states, dead or alive. Each cell has eight neighbors which are the cells that are horizontally, vertically, and diagonally adjacent. At each step in time, the following rules decide the next generation: 1. Any live cell with fewer than two live neighbours dies, as if caused by underpopulation. 2. Any live cell with two or three live neighbours lives on to the next generation. 3. Any live cell with more than three live neighbours dies, as if by overpopulation. 4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction. I added a twist to the game in is in the form of colors which are randomly assigned to each cell on the game's intialization. At each step any live cell is randomly assigned one of the colors from its live neighbors. Sort of like passing down traits from one generation to the next, with each new generation having equal chance to inherit the color from any one of its live neighbors' or 'parents''. Written in TypeScript. Tap to start & stop, double tap to reset