Skip to content

Instantly share code, notes, and snippets.

View themojilla's full-sized avatar
🎯
Focusing

Kia. themojilla

🎯
Focusing
View GitHub Profile
@themojilla
themojilla / .gitlab-ci.yml
Created February 17, 2019 07:19 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
kubectl get services # List all services
kubectl get pods # List all pods
kubectl get nodes -w # Watch nodes continuously
kubectl version # Get version information
kubectl cluster-info # Get cluster information
kubectl config view # Get the configuration
kubectl describe node <node> # Output information about a node
kubectl get pods # List the current pods
kubectl describe pod <name> # Describe pod <name>
kubectl get rc # List the replication controllers
@themojilla
themojilla / what-forces-layout.md
Created September 6, 2020 21:28 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

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.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent

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.


Effective Engineer - Notes

What's an Effective Engineer?

Here is a non-exhaustive list of books that have influenced how I think about software.

@themojilla
themojilla / clean_code.md
Created December 8, 2020 15:32 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

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.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

module.exports = {
plugins: [
require("tailwindcss"),
require("autoprefixer"),
process.env.NODE_ENV === "production" && require("cssnano"),
].filter(Boolean),
};
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");
@themojilla
themojilla / ideas.md
Created March 11, 2021 08:54 — forked from tsaqib/ideas.md
Ideas that you can use for hackathons, competitions and research.

Ideas

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.

Categories:
  • Eradicate Extreme Poverty and Hunger
  • Education
  • Healthcare
  • Governance
@themojilla
themojilla / try-catch.ts
Created May 6, 2021 00:35 — forked from karlhorky/try-catch.ts
Try-catch helper for promises and async/await
export default async function tryCatch<T>(
promise: Promise<T>,
): Promise<{ error: Error } | { data: T }> {
try {
return { data: await promise };
} catch (error) {
return { error };
}
}