From: https://dev.to/rizkyzhang/setup-multiple-ssh-keys-for-multiple-github-accounts-393l
ssh-keygen -t rsa -f ~/.ssh/id_rsa_fulltime -C "[email protected]"
ssh-keygen -t rsa -f ~/.ssh/id_rsa_portfolio -C "[email protected]"
export function rounded(number: number, decimals: number = 2): number { | |
return Math.round(number * Math.pow(10, decimals)) / Math.pow(10, decimals); | |
} |
#!/bin/bash | |
# Create a (draft) pull request using GitHub CLI. | |
# It assigns the PR to the current user, fills in the title from the first commit, | |
# and uses the PR template file for the description. | |
set -euo pipefail | |
# Colors for output | |
RED='\033[0;31m' |
import { FileWithPath } from "react-dropzone-esm"; | |
function hasFileWithName(set: Set<FileWithPath>, name: string) { | |
return [...set].some((file) => file.name === name); | |
} | |
export function combineUniqueFileSets<T extends FileWithPath>(set1: Set<T>, set2: Set<T>): Set<T> { | |
const combinedSet = new Set<T>(); | |
// Add all elements from set1 to the combinedSet |
From: https://dev.to/rizkyzhang/setup-multiple-ssh-keys-for-multiple-github-accounts-393l
ssh-keygen -t rsa -f ~/.ssh/id_rsa_fulltime -C "[email protected]"
ssh-keygen -t rsa -f ~/.ssh/id_rsa_portfolio -C "[email protected]"
import { useToast } from "@chakra-ui/react"; | |
import { exists } from "app/core/utils/js-utils"; | |
import { QueryFn, useMutation } from "blitz"; | |
import { MutationOptions } from "react-query"; | |
type ShowLoginOnFailFn = (s: any) => boolean; | |
type CustomOptions = { | |
errorMessage?: string; | |
showLoginOnFail?: boolean | ShowLoginOnFailFn; |
import re | |
from zipfile import ZipFile, Path | |
""" | |
TailwindCSS plugin patcher for IntelliJ IDEA | |
-------------------------------------------- | |
1. Download the latest ZIP of the plugin compatible with your version of IntelliJ here: | |
https://plugins.jetbrains.com/plugin/15321-tailwind-css/versions | |
2. Fill `CLASS_ATTRIBUTES` to specify which XML attributes can contain Tailwind classes. |
import React from "react" | |
import {InternalRoutes} from "types/routes" | |
import Link, {LinkProps} from "next/link" | |
export function InternalLink({ | |
routeName, | |
routeParams, | |
...linkProps | |
}: Omit<LinkProps, "href" | "as"> & | |
InternalRoutes & {children: React.ReactChild}) { |
const formatPrice = (price: number | undefined) => { | |
if (!price) return "" | |
return ( | |
price | |
.toLocaleString("en-US", { minimumFractionDigits: 2 }) | |
.replace(/\D00(?=\D*$)/, "") | |
.replace(",", " ") | |
.replace(".", ",") + " zł" | |
) | |
} |
//---------------------------------------------------------------- | |
// ------------------- ServerSide(NODE.JS) ------------------- | |
//---------------------------------------------------------------- | |
function encrypt(message){ | |
const KEY = crypto.randomBytes(32) | |
const IV = crypto.randomBytes(16) | |
const ALGORITHM = 'aes-256-gcm'; | |
const cipher = crypto.createCipheriv(ALGORITHM, KEY, IV); | |
let encrypted = cipher.update(message, 'utf8', 'hex'); |
Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.
Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.