Messing Around With Trig

󰃭 2013-03-05

Yesterday after work I had some time to waste, so I decided to do some silly things in javascript with a canvas and some trigonometric magic.

Move your mouse around to change some variables, and click to toggle clearing of the canvas. You can achieve some trippy effects!

colorful sine wave sine wave

colorful flower flower

These are all on my github, in case you wanna take a look.



More posts like this

Migrating old-style JavaScript code to ES6

󰃭 2017-12-28 | #es6 #javascript #refactoring #webpack

Recently (at work) I had to migrate a medium-sized JavaScript codebase (20KLOC) to ES6. We wanted to migrate to take advantage of the new features such as arrow functions, destructuring, and classes (there are a bunch more!). Additionally, I was tasked with introducing eslint and prettier to improve the quality of our code a bit more. Before diving into the migration process, first I’d like to give some context on the state of the application.

Continue reading 


Using AsyncLocalStorage for Better Traceability in NodeJS Applications

󰃭 2024-09-29 | #javascript #nodejs #tutorials

NodeJS has a neat API called AsyncLocalStorage. It’s used to share information across callbacks and promise chains. For example, it is useful to share information for all the code executed when serving a web request. I also found it very useful to keep trace information to easily keep track of which item was being processed during a batch process. The only caveat in my opinion, is that you need to wrap your code in yet another callback.

Continue reading 