talk: https://www.youtube.com/watch?v=rI8tNMsozo0
slides: https://www.slideshare.net/evandrix/simple-made-easy
"Simplicity is prerequisite for reliability" -- Dijkstra
Simple:
- vs complex
talk: https://www.youtube.com/watch?v=rI8tNMsozo0
slides: https://www.slideshare.net/evandrix/simple-made-easy
"Simplicity is prerequisite for reliability" -- Dijkstra
Simple:
// Based on: https://kyleshevlin.com/snippets/spacer | |
// PurgeCSS will remove the Tailwind margin classes from a production build. | |
// In order to keep them, you can safelist them via: https://tailwindcss.com/docs/optimizing-for-production#purge-css-options | |
type Margin = number | string; | |
type Margins = { | |
readonly top?: Margin; | |
readonly right?: Margin; | |
readonly bottom?: Margin; |
export default async function tryCatch<T>( | |
promise: Promise<T>, | |
): Promise<{ error: Error } | { data: T }> { | |
try { | |
return { data: await promise }; | |
} catch (error) { | |
return { error }; | |
} | |
} |
I have collected and moderated these ideas from various public sources and put into one place so that problem solvers and solution developers may find inspirations. Because I wish to update it regularly, I have setup as a single page wiki. You may try these ideas on hackathons/competitions/research; some are quite intense problems and some are not. Many of the problems were prepared keeping Dhaka/Bangladesh in mind, but of course can be applied to just about any underdeveloped/developing and sometimes developed countries.
const fsp = require("fs").promises; | |
const path = require("path"); | |
const { execSync } = require("child_process"); | |
const chalk = require("chalk"); | |
const Confirm = require("prompt-confirm"); | |
const jsonfile = require("jsonfile"); | |
const semver = require("semver"); | |
const packagesDir = path.resolve(__dirname, "../packages"); |
module.exports = { | |
plugins: [ | |
require("tailwindcss"), | |
require("autoprefixer"), | |
process.env.NODE_ENV === "production" && require("cssnano"), | |
].filter(Boolean), | |
}; |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
Here is a non-exhaustive list of books that have influenced how I think about software.
FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent