NoSleepJavascript Blog

A blog by franleplant

I talk about Programming, Tech Culture and random stuff.

Subscribe to our mailing list!

© 2022, nosleepjavascript.com

Cardano will never have smart contracts

August 31, 2021 • 5 min read • by franleplant

Let's talk about the upcoming Cardano Alonzo hard fork and what we are going to see in the future

#cardano#smart contracts#smart transactions#plutus#blockchain

Rock-paper-scissors game built in Cardano smart contracts

August 10, 2021 • 8 min read • by franleplant

A quick high level overview of how you can write a state machine based smart contract in the upcoming Cardano's Plutus platform for Smart Contracts or Smart Transactions.

#haskell#cardano#plutus#blockchain#smart contracts#smart transactions#game#state machines#plutus pioneer program

How to use CSS flex gap in unsupported browsers

April 23, 2021 • 3 min read • by franleplant

Quick post about how to use the CSS gap property with flex layout mode in browsers that still don't support it, like Safari

#css#flex#gap#layout#safari

The Stoic Developer

April 22, 2021 • 8 min read • by franleplant

Developers are high performance professional thinkers and thus we are particularly susceptible to problems of the mind. Stoicism has helped me greatly to tackle these problems and this is an attempt to help others in the same way.

#stoicisim#mental health#anxiety#panic attacks#stress#neurosis

Rewriting the NSJS blog in Tailwind Css

April 18, 2021 • 6 min read • by franleplant

My blog has been long overdue for some aesthetic love and I decided to give Tailwind a run for its money. This is my experience.

#tailwindcss#css#postcss#styling#dark mode

Thinking about startups

January 18, 2021 • 5 min read • by franleplant

For my entire life I've always wanted to change the world, perhaps the time is ripe for me to do just that.

#y combinator#incubators#startup#entrepreneur#life

Javascript is the best programming language in the world

January 08, 2021 • 12 min read • by franleplant

On the nature of love and hate for inanimate things such as programming languages and how to take a more objective stance against the vast programming landscape.

#typescript#javascript#rust#java#C/C++#programming languages#reflection#toxic culture

NoSleep Javascript 2020 in review and plans for 2021

January 02, 2021 • 13 min read • by franleplant

Let's talk about the amazing growth we've seen in 2020 and what plans we have for 2021. Thank you!

#year in review#plans for 2021#meta#Machine Learning#Artificial Intelligence#Rust#Python#React#Typescript

Interview with React Query's creator: Tanner Linsley

December 18, 2020 • 13 min read • by franleplant

It is a pleasure to bring you a interview with Tanner Linsley, React Query creator, open source maintainer, dad, family man, religious man and so much more, let’s get to know him and see what he has to say about programming, open source and so much more.

#react#react-query#redux#data-fetching#cache#react hooks

Breaking the iframe frontier: ibridge

December 11, 2020 • 9 min read • by franleplant

Introducing ibridge, a tiny, typesafe, promise-based library for bidirectional and secure iframe communication.

#ibridge#typescript#javascript#iframe#postMessage#event emitter#Emittery#jsdom

React is slow, what now?

December 04, 2020 • 11 min read • by franleplant

We study React applications performance from the ground up, the processes involved, the tools to measure and identify slow parts, the important metrics to take in account, how these impact the UX and the various ways there are available to make applications super fast and smooth. Grab a cup of coffee and enjoy the ride.

#React#Javascript#Typescript#props#state#chrome dev tools#react dev tools

Secrets of a Tech Lead: Programming Principles

November 27, 2020 • 8 min read • by franleplant

Let's cover the main programming principles I have developed. They act as a Technical Compass that help me navigate all the decision I have to make constantly; ranging from the high level architectural to the low level naming, function structures, etc.

#Tech Lead#Architect#Principles#clarity#simplicity#consistency#reading code

Bitbucket is developer hell

November 20, 2020 • 6 min read • by franleplant

Bitbucket sucks for developers because it was made for managers

#Bitbucket#Github#markdown#git#PR#Pull Request#code review

Stop using Redux for Data Fetching, use this instead

November 10, 2020 • 10 min read • by franleplant

Modern tools and technique have superseded using Redux for data fetching, providing a more effective and efficient solution to this problem, reducing the amount of code and decisions we need to make in order to fetch data which is common, day to day, task in modern app development.

#TypeScript#Javascript#React#react-query#redux#redux-toolkit#data fetching#reactive data flow

Jest makes unit testing fun again

November 04, 2020 • 7 min read • by franleplant

Why I love Jest and why you should consider it for your next project.

#jest#typescript#javascript#unit testing#mock#Node.js#mocha#React.js#jsdom

Authenticating your Node.js app with Google as an OpenId Connect Provider

October 23, 2020 • 19 min read • by franleplant

Let's build the basic boilerplate for OpenId Connect based authencation with Google as Identity provider, persistent session cookies, express middleware in Typescript and Node.js

#TypeScript#Javascript#Nodejs#express#OpenId Connect#oidc#OAuth 2.0#middleware#Single Sign On#microservice

How to create route namespaces with Express

August 07, 2020 • 5 min read • by franleplant

Let's quickly cover how to create namespaces in Express.js, something that is not so evident in the official docs and is farily common.

#Javascript#Typescript#NodeJs#Express#Namespace#Router

How to write CHANGELOGs

May 07, 2020 • 3 min read • by franleplant

Whether you are working on an open source library or an internal private library you should master the art of CHANGELOG. This is a fundamental not-code part of maintaining libraries and enables consumers to understand what they can expect when moving from version to version.

#Open Source#NodeJS#library#NPM#Javascript#Typescript#package#private npm registry

How to support multiple authors in Gatsby.js

April 27, 2020 • 6 min read • by franleplant

Gatsby Starter Blog doesn't support multiple authors by default. Let's fix that! And in the Journey we will uncover how to use the file system as source of dynamic data

#GatsbyJs#Javascript#react#filesystem#yaml#blog#GraphQL

Essential Investing and Finance for developers

April 20, 2020 • 8 min read • by franleplant

Whether you are working on a fin tech startup or you want to start investing or you simply are curious about the world of investing and finance this post will be for you. We will layout a roadmap to learn the basics and beyond that resembles the path I’ve taken myself.

#investing#finance#ETF#financial instruments#options#futures#stocks#portfolio#wealth#fintech

Intro to game development with Typescript

April 13, 2020 • 27 min read • by nacho

Creating a game is easier than ever with all the tools that we have available. This article will hopefully ease you into game development, reviewing both general concepts and specific implementations with the help of robust technologies such as TypeScript and PixiJS by creating a small clone of a pretty well-known game!

#gamedev#WebGL#PixiJS#TypeScript#rendering

Essential Docker for Javascript and Front End Developers

March 10, 2020 • 9 min read • by franleplant

Docker has become a widely used technology and chances are you are going to have to deal with it eventually, at least superficially, in your Front End career. Let's cover the basic concepts and day to day useful commands you will likely use when dealing with Docker.

#Docker#Dockerfile#Javascript#front end developers#NodeJs#Express#Cloud Computing#Clusters#Kubernetes#AWS#Azure#Google Compute Engine

How to share React Components between Applications via NPM

January 21, 2020 • 25 min read • by franleplant

In this post we explore in detail how to share React Components which are typically made of a bundle of Javascript, CSS (styles), Images, etc. We explore how to package and bundle the code with Webpack so that it can be published and distributed via a public or private NPM repository and later consumed appropriately. We also analyze different theming strategies for larger Component Libraries and UI Frameworks. And finally we provide a recommended way of packaging your Components in a simple and very flexible way.

#React#Javascript#Typescript#CSS#Webpack#NPM#code sharing#publishing

Using Azure Functions to create a page view counter

December 26, 2019 • 15 min read • by nacho

We can extend static sites by creating a simple page view counter that is processed in a serverless manner, and for free. Microsoft Azure provides Functions as a flagship service to do this. Let's explore building it on Visual Studio.

#azure functions#storage#.NET#cloud#serverless

Create a blog with Gatsby.js

December 23, 2019 • 10 min read • by franleplant

In this post we are going to cover the steps we took to create the nosleepjavascript.com blog in simple, easy, steps using the latest front end technologies: Gatsby.js (JAMstack), NodeJs, React, GraphQL, Javascript, GitHub Pages and GitHub Actions

#gatsbyjs#javascript#react
#ethereum#typescript#javascript#polygon

Introducing Carolus: decentralized, uncensorable and on-chain newspaper

January 29, 2022 • 3 min read

Written by franleplant: Tech Lead and Software developer with a degree in Engineering. Woodworker, all things Javascript, Rust and Software Architecture. Github

For the past couple of weeks I have been playing around with the idea of news that are stored completely on-chain to make them uneditable and uncensorable.

Carolus is the result of that experimentation and I expect it to be just one of many examples of web3 dapps that are non-financial applications.

At its core, Carolus is really simple: it is a place where journalists, archivers and amateurs can publish news that won’t be affected by the well known problems that traditional and centralized media suffer.

The news piece is modeled as an ERC-721 compliant NFT that can be traded in OpenSea. Out of the box, it serves as a way to monetize content but also as a way for collectors to collect news that mean something for them and that they simply want to be the guardians of.

Creators pay a flat fee for minting (publishing) news. Those fees go to the Carolus Treasury.

Other models of storage are possible but the purest, more secure but most expensive is fully on-chain. To avoid paying obscene fees I chose a Layer2 scaling solution: Polygon, which is one of the most important L2 currently and has a great future.

What if the news are objectively harmful?#

I won’t dwell too much what this actually means in this post, let me know if you are interested in exploring this topic further.

Carolus lets the users vote up or down a given news piece. If the ratio of dislikes to likes is more than 10 then the news can be censured by a moderator.

The exact parameters of this functionality will be something I would expect many variants will exist and that a decent amount of exploration and experimentation can be made. I choose a really simple model that would give power to the community.

In this beta version the moderator will be a wallet controlled by an individual (me) but in future versions I see a DAO being formed that will both have moderation roles and will decide what to do with the Treasury.

As this is still a beta product or an experiment even I am leaving an emergency mechanism to remove harmful content. I can only promise I will use it only to remove really bad things and never to censure someones opinion. Eventually this kill switch could be removed altogether.

Forking#

In future iterations I plan to add a forking functionality. If the controlling moderator (individual or DAO) starts censoring more than its fair share, it should be really straight forward to fork (copy and create a new instance) the contract, deploy a new front-end and avoid the censorship altogether.

This would include concrete instructions, scripts and general documentation to make this mechanism as easy as possible.

Carolus Treasury#

In this early beta project the treasury will be used to finance the development of Carolus, if it becomes large enough I plan to release a more comprehensive strategy to use it for the common good.

Why the name: Carolus?#

Johann Carolus was the publisher of the first newspaper. Carolus is probably one of the first web3 newspaper.

Closing#

All the code is open source: contract, api and client.

Go to Carolus