Skip to content

Instantly share code, notes, and snippets.

View thesabbir's full-sized avatar

Sabbir Ahmed thesabbir

View GitHub Profile
@thesabbir
thesabbir / add-missing-import-extensions.txt
Created April 30, 2024 15:08 — forked from wojtekmaj/add-missing-import-extensions.txt
Visual Studio Code-compatible regular expression to add all missing import extensions
# Find
import\s(([^;]|\n)*)\sfrom\s(['"])(\.{1,2}\/.*)(?<!\.js)(?<!\.(css|pdf|png|jpg|jsx|mjs|mp3|mp4|svg|ttf))(?<!\.(avif|json|webm|webp|woff))(?<!\.woff2)(['"]);
# Replace with
import $1 from $3$4.js$7;
const input1 = [1, 1, 2, 2, 3, 3, 8, 4, 4];
const onlyOnce = (input) => {
const result = [];
input.filter((item) => {
let times = 0;
input.forEach((item2) => {
if (item === item2) {
times += 1;
CPU value Memory value (MiB)
256 (.25 vCPU) 512 (0.5GB), 1024 (1GB), 2048 (2GB)
512 (.5 vCPU) 1024 (1GB), 2048 (2GB), 3072 (3GB), 4096 (4GB)
1024 (1 vCPU) 2048 (2GB), 3072 (3GB), 4096 (4GB), 5120 (5GB), 6144 (6GB), 7168 (7GB), 8192 (8GB)
2048 (2 vCPU) Between 4096 (4GB) and 16384 (16GB) in increments of 1024 (1GB)
4096 (4 vCPU) Between 8192 (8GB) and 30720 (30GB) in increments of 1024 (1GB)
 ./
├──  Avatar/
│ └──  Avatar.tsx
├──  Button/
│ ├──  Base.spec.tsx
│ ├──  Base.tsx
│ ├──  Button.module.scss
│ ├──  Button.spec.tsx
│ ├──  Button.stories.mdx
│ ├──  Button.tsx
@thesabbir
thesabbir / reset.css
Last active May 20, 2021 11:45
My | minimalist css reset :)
body {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
padding: 5px;
line-height: 1.15;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
@thesabbir
thesabbir / NestedListRenderer.js
Created May 9, 2021 16:57
Editorjs Nested List render
import React from "react";
const NestedListRenderer = ({ data }) => {
const ListType = ({ children, style }) =>
style === "unordered" ? <ul>{children}</ul> : <ol>{children}</ol>;
const renderWalk = (items) =>
!!items.length && (
<ListType style={data.style}>
{items.map((item) => (
@thesabbir
thesabbir / utc.py
Last active May 20, 2021 11:24
Python to create Javascript date time (in utc iso)
from datetime import datetime
datetime.utcnow().isoformat()[:-3]+'Z'
@thesabbir
thesabbir / .zshrc
Last active May 25, 2021 14:06
Zsh config
export ZSH="/Users/sabbir/.oh-my-zsh"
export UPDATE_ZSH_DAYS=30
ZSH_THEME="spaceship"
DISABLE_UPDATE_PROMPT="true"
COMPLETION_WAITING_DOTS="true"
plugins=(git zsh-iterm-touchbar zsh-autosuggestions history-substring-search git-extras git-flow npm node z extract fancy-ctrl-z zsh_reload docker git-extras osx yarn zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
@thesabbir
thesabbir / .eslintrc.json
Created January 9, 2017 10:08
Eslint config
{
"parser": "babel-eslint",
"extends": "airbnb/base",
"plugins": [
"flowtype",
"flowtype-errors",
"html"
],
"rules": {
"import/no-extraneous-dependencies": 0,
@thesabbir
thesabbir / bitbucket-pipelines.yml
Created January 9, 2017 10:06
Bitbucket pipeline example for JS projects
image: node:7.0 #node v7
clone: # the 'clone' section
depth: 1 # latest commit only
pipelines:
default:
- step:
script:
- npm i -g yarn
- yarn