Cool Tech


Back to Tags

esbuild-loader

🗓️ July 15, 2021

There’s been a lot of new developments in the space of package bundlers. From the OG

Webpackto, Rollup to the new kid on the block esbuild each of them have their own unique set of features.

esbuild offers better build times as it is written in Go, which is compiled to JavaScript. The tradeoff here is that es5 isn’t supported (but that’s okay if you’re not supporting IE11). It’s pretty awesome but as it’s in active development and fairly new, it’s not as widely used as the other bundlers and therefore doesn’t have the rich plugin resource that somethings like webpack has.

However, you can leverage esbuild and plug it into a webpack config and via esbuild-loader

I did this at work today and it helped with devserver startup times and greatly improved the production build times.

s-max-age

🗓️ November 23, 2020

TIL that there is a cache control header for a shared cache. The s-max-age is similar to the max-age in that they both set a timer to invalidate a cache for a particular resource. The difference between the two is that the s-max-age applies to shared content and therefore applies to content on a CDN.

This is better in circumstances where we want to force an invalidation for a particular resource. This is not possible with max-age.

Netlify Identity Widget

🗓️ November 16, 2020

There’s a Netlify Identity Widget (that is framework agnostic) which can be leveraged to add some authentication to web apps deployed to Netlify.

There’s a limit of 1000 people but for a small e-commerce business that’s more than enough.

Here it is

pascal-triangle

🗓️ September 03, 2020

While working through my functional programming course, I encountered a fun little leet code exercise. It’s fucking computer science so I’m not even surprised I had to solve a problem like this -.-

Anyway, here’s how the pascal triangle code will work in JS and in Scala

js-example
function run() {
  for (let row = 0; row <= 10; row++) {
    const rec = []
    for (let col = 0; col <= row; col++) {
      rec.push(pascal(col, row))
    }
    console.log(rec)
  }
}

const pascal = (col, row) => {
  if (col === 0 || row < 1 || col === row) return 1
  else return pascal(col, row - 1) + pascal(col - 1, row - 1)
}

run()
scala-example
def main(args: Array[String]): Unit = {
  println("Pascal's Triangle")
  for (row <- 0 to 10) {
    for (col <- 0 to row)
      print(s"${pascal(col, row)} ")
    println()
  }
}

/**
  * Exercise 1
  */
def pascal(c: Int, r: Int): Int = {
  // base case is if c = 0, just 1
  if (c == 0 || r < 2 || c == r) 1
  else pascal(c, r -1) + pascal(c - 1, r - 1)
}

Free HTTPS certs

🗓️ May 07, 2020

Don’t be a sucka! TIL that you can get free HTTPS on your server thanks to a handy tool called Certbot.

Suck on that people who tried to charge me for HTTPS.

EC2 tiers

🗓️ January 27, 2020

Long story short, t tiers of ec2 instances are spotty and unreliable; stick to using m series at the very least

Single sign-on

🗓️ January 11, 2020

Single sign-on (SSO) is a property of access control of multiple related, yet indepdent records. Thanks to this property, users can log in with a single ID and password to gain access to any of several related systems.

If you’re working in a corporate setting, this is how you’re able to seamlessly switch between applications (maybe in the browser) and not have to log in despite the fact that all these systems have some sort of authentication and authorization piece associated with them.

Read more about it here!

UTF-8 and encodings

🗓️ November 17, 2019

I’ll be honest, up until today, I never really cared about character encodings and didn’t ever bother to learn anything about them… what a huge mistake! Character encodings are the unsung heroes that allow us to display languages (besides English) reliabely on computer systems.

The gist of UTF-8 is that it is an encoding that allows us to take Unicode code and map said codes to meaningful linguinstic representations. Codes that are between 0 and 127 occupy 8 bits — a single byte — and then any codes above this upper bound can use up to 6 bytes. The beauty of this system is that strings encoded in UTF-8 look exactly the same as strings encoded in ASCII. Americans are chilling and don’t need to worry about squat, while the rest of the world has to “jump through hoops” to make sure that they’re alphhabet will work across computer systems.

Read more here

Buddy works!

🗓️ July 05, 2019

Buddy works allows us to create pipelines for our projects! Similar to how envoyer and deploybot works!
It comes with a bunch of prebuilt recipes for when you try to set up your actions. We’re using it to do deployments to a project site after PRs are merged and firing off notifications on slack!

Check it out