Skip to content

Instantly share code, notes, and snippets.

View AndersonNascimentoDosSantos's full-sized avatar
🎯
Focusing

Anderson Nascimento Dos Santos AndersonNascimentoDosSantos

🎯
Focusing
View GitHub Profile
@AndersonNascimentoDosSantos
AndersonNascimentoDosSantos / _app.js
Created April 21, 2022 14:19 — forked from claus/_app.js
Restore scroll position after navigating via browser back/forward buttons in Next.js
import useScrollRestoration from "utils/hooks/useScrollRestoration";
const App = ({ Component, pageProps, router }) => {
useScrollRestoration(router);
return <Component {...pageProps} />;
};
export default App;
@AndersonNascimentoDosSantos
AndersonNascimentoDosSantos / SlugifyTitle.sql
Last active August 27, 2023 18:25
convert title into slug directly in the mySQL 8
DELIMITER //
CREATE FUNCTION SlugifyTitle(title VARCHAR(255), sep CHAR(1))
RETURNS VARCHAR(255)
BEGIN
SET title = REPLACE(CONVERT(title USING utf8mb4),'š', 's');
SET title = REPLACE(CONVERT(title USING utf8mb4),'Đ', 'Dj');
SET title = REPLACE(CONVERT(title USING utf8mb4),'đ', 'dj');
SET title = REPLACE(CONVERT(title USING utf8mb4),'Ž', 'Z');
SET title = REPLACE(CONVERT(title USING utf8mb4),'ž', 'z');
"use client";
import { Button } from "@/components/ui/button";
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form"; //shadcn ui folder