Skip to content

Instantly share code, notes, and snippets.

@rifayetuxbd
rifayetuxbd / prettier.config.js.md
Last active December 31, 2023 22:54
Prettier config for nextjs application

Prettier config for nextjs applciation

install dev dependencies

pnpm add -D prettier@latest prettier-plugin-tailwindcss@latest @ianvs/prettier-plugin-sort-imports@latest

create file prettier.config.js in root dir

prettier.config.js

@j-bullard
j-bullard / App.tsx
Created July 4, 2021 07:15
Headless UI with React Hook Forms
import "./styles.css";
import { Person } from "./types";
import { Listbox } from "./listbox/listbox";
import { useForm } from "react-hook-form";
const people: Person[] = [
{ id: 1, name: "Durward Reynolds", unavailable: false },
{ id: 2, name: "Kenton Towne", unavailable: false },
{ id: 3, name: "Therese Wunsch", unavailable: false },
{ id: 4, name: "Benedict Kessler", unavailable: true },
@JLarky
JLarky / README.md
Last active April 26, 2024 02:43
Ultimate example of react context hook with nice type-safe (TypeScript) wrappers and reduced boilerplate by using `ReturnType`
@gjerokrsteski
gjerokrsteski / remove env file from git forever
Last active April 30, 2024 16:08
remove env file from git history forever
echo '.env' >> .gitignore
git rm -r --cached .env
git add .gitignore
git commit -m 'untracking .env'
git push origin master
@ygrenzinger
ygrenzinger / CleanArchitecture.md
Last active March 31, 2024 13:57
Summary of Clean Architecture by Robert C. Martin

Summary of book "Clean Architecture" by Robert C. Martin

Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.

Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.

Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.

The book is build around 34 chapters organised in chapters.

@brennanMKE
brennanMKE / hero.ts
Last active April 1, 2024 16:16
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@mondain
mondain / public-stun-list.txt
Last active May 2, 2024 21:46
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@mziwisky
mziwisky / Oauth2.md
Last active February 15, 2024 23:31
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.