Skip to content

Instantly share code, notes, and snippets.

function ImageOverLay() {
return (
// class image
<div className="w-full h-[500px] bg-center bg-cover bg-[url('../../public/happyGuy.jpg')] ">
{/* class image-overlay */}
<div className="w-full h-[500px] bg-gradient-to-r bg-[rgba(0,48,93,.6)] flex justify-center items-end gap-4">
{/* job finder with three dots */}
<div className="">
<div className="bg-white p-1">
@DanielHemmati
DanielHemmati / keybindings.json
Created January 1, 2023 22:10
keyboard shortcut for vscode
// Place your key bindings in this file to override the defaults
[
// {
// "key": "shift+ctrl+=",
// "command": "editor.action.fontZoomIn"
// },
// {
// "key": "ctrl+=",
// "command": "editor.action.fontZoomIn"
// },
@DanielHemmati
DanielHemmati / settings.json
Created January 1, 2023 22:09
vscode setting
{
// "editor.rulers": [140] // if you ever wanted it
"editor.lineHeight": 25, // it works really well with vim
// bracket colorize
"editor.bracketPairColorization.enabled": true,
"editor.guides.highlightActiveBracketPair": true,
"editor.guides.bracketPairsHorizontal": "active",
"editor.guides.bracketPairs": "active",
"editor.autoClosingBrackets": "always",
"editor.detectIndentation": false,
@DanielHemmati
DanielHemmati / keyboard.json
Last active November 7, 2022 08:23
just in case of fire
// Place your key bindings in this file to override the defaults
[
// {
// "key": "shift+ctrl+=",
// "command": "editor.action.fontZoomIn"
// },
// {
// "key": "ctrl+=",
// "command": "editor.action.fontZoomIn"
// },
@DanielHemmati
DanielHemmati / _app.ts
Created November 1, 2022 15:26
next.js with next-auth and react query. the way type is written is really messy.
import { SessionProvider } from "next-auth/react";
import "../styles/globals.css";
import {
Hydrate,
QueryClient,
QueryClientProvider,
} from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import type { AppProps } from "next/app";
@DanielHemmati
DanielHemmati / prisma.ts
Last active January 11, 2023 20:50
prisma client for nextjs
// https://github.com/prisma/prisma/discussions/10037
// and why it does matter: https://www.prisma.io/docs/concepts/components/prisma-client/working-with-prismaclient/instantiate-prisma-client#the-number-of-prismaclient-instances-matters
import { PrismaClient } from "@prisma/client";
let prisma: PrismaClient;
if (process.env.NODE_ENV === "production") {
prisma = new PrismaClient();
} else {
let globalWithPrisma = global as typeof globalThis & {
@DanielHemmati
DanielHemmati / char.js
Created July 22, 2022 11:13
check if the char is alphanumeric
// source: https://stackoverflow.com/questions/4434076/best-way-to-alphanumeric-check-in-javascript
// i just edited a little bit
/**
*
* @param {string} char
* @returns
*/
function isAlphaNumeric(char) {
let code = char.charCodeAt(0);
if (
@DanielHemmati
DanielHemmati / Count lines in Git repo
Created June 15, 2022 17:47 — forked from mandiwise/Count lines in Git repo
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@DanielHemmati
DanielHemmati / tailwind.config.js
Created May 3, 2022 16:23 — forked from mmikhan/tailwind.config.js
Tailwind CSS `grid-template-columns: auto-fit; grid-template-columns: auto-fill;` and `grid-template-rows: auto-fit; grid-template-rows: auto-fill;`
module.exports = {
purge: [],
theme: {
extend: {
gridTemplateColumns: {
'auto-fit': 'repeat(auto-fit, minmax(0, 1fr))',
'auto-fill': 'repeat(auto-fill, minmax(0, 1fr))',
},
gridTemplateRows: {
'auto-fit': 'repeat(auto-fit, minmax(0, 1fr))',
/* -------------- */
/* Global styling */
/* -------------- */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {