Imagine a world where no one has to worry about their rent, next meal, or bills. It sounds like a utopia, right? That’s because we are conditioned to believe that such dreams are unattainable ideals. In reality, you are owed a basic income for your mere existence as a citizen in a country. Let’s explore why that’s the case.
Not everyone has the equal ability to compete for the good life. Many people are born into poor families that do not have financial or social means to provide more for their kids. …
Event handlers are asynchronous events that can benefit from mutual exclusion. Events like scroll and button click handlers can fire off multiple events within a second, but sometimes you only need the first event (and the others are undesirable). We need a way to be able to guarantee the order of the asynchronous events.
async-mutex is an npm package that implements the synchronizing primitives, allowing you to control asynchronous events deterministically.
The synchronizing primitives are Mutex and Semaphore.
Herbert Fingarette passed away on November 2, 2018, leaving us with thought-provoking inquiries into Death.
I recently watched a 97-year-old philosopher describe how he feels about his own coming death. Fingarette was an accomplished philosopher and professor of Philosophy at the University of California. He even wrote a book on Death. In the video, he describes that he argued in his book on Death —over 20 years ago — that our fear of death is irrational because when you are dead, you won’t feel sadness, anger, or anything really. You just won’t be.
However, at 97, significantly closer to facing his own mortality, he had a change of heart. He says that while the several other books he wrote made him feel that he was able to rationalize the ideas behind them, the one thing he failed was to rationalize Death itself. He describes how he is afraid of his coming death, and how he wishes he can just stick around, despite how heinous our world seems sometimes. …
Hackers are most likely to succeed in compromising user accounts through exploiting the design of internet protocols. In this article, I would like to focus on a feature of HTTP that has proven to also be a liability: cookies.
Yes, cookies are super useful. Websites extensively utilize cookies for session storage. Once you login to a website, the server dispatches some session cookies that your web browser remembers for a certain period of time. Cookies greatly improve user experience. I mean, can you imagine having to login for every single page navigation on a website?
But their usefulness does come at a security price — they enable one of the most common HTTP attacks that are trivial to carry out: Cross-Site Request Forgery (CSRF). Let’s discuss a hypothetical example to illustrate the danger of CSRF attacks. An imaginary payment processor called PurplePay will be used. …
Why should you rent a whole server for simple requests? For most websites, conventional servers are often idle 99% of the time until someone needs some service to be performed. So why not have the ability to only use a server when needed? This is one of many fundamental motivations behind why serverless architectures were pursued and popularized in recent development world.
The web should be built for the inclusion of all. Smartphone adoption is, needless to say, ubiquitous. If you are designing a website and you are tackling the issue of making your font sizes responsive, then read on! I am going to introduce you to an amazing SASS module named RFS (which stands for response font size).
Isn’t that amazing? As the width of the viewport gets smaller, the font size adjusts along with it. This helps provide a linear experience in terms of font sizes regardless of screen size!
The magic behind RFS
In summary, RFS takes your fixed font size unit (
rem) and applies a linear algorithm of size reduction for screen width sizes of
1200px or lower. Here is a graph illustrating the linear algorithm that is displayed on the github page of RFS. …
You might have faced issues with
npm install automatically picking up a new version of a dependency that broke your build. And you might have also heard of the incident where a programmer deleted several npm packages that millions of people depended on. Fortunately, there are some good practices we can adopt to minimize our exposure to external factors.
npm packages follow the
major.minor.patch versioning format (e.g., 7.3.4). While the numbers themselves are arbitrary, how they change is not:
Python is a versatile language. If you are making use of the Object-oriented (OO) capabilities, you will be happy to learn about magic methods, and how you can leverage them to your advantage. Let’s dive in!
Magic methods allow us to override default operator functionality or Class behavior on creation, initialization, and even destruction. A magic method is always prefixed and post-fixed by two underscores
__ . If you’ve used Python for OO programming, you have likely used the magic method
__init__ almost every time!
Let’s explore several magic methods with some practical examples.
__new__() is called by python to create an object before
__init__() is called to initialize the object. Use of
__new__() is not needed in most cases as it can be abused to allow for anti-patterns in development. However,
__new__() is specifically useful — and acknowledged by the official python documentation here — when you need to extend the behaviour of immutable types like tuples. …
Web bundling is the process of fetching, resolving, packing, reducing a tree of dependencies into compressed static files that you may readily host on the web. The original pioneering package in web bundling is the famous Webpack. …