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
@AndersonNascimentoDosSantos
AndersonNascimentoDosSantos / install.sh
Created July 26, 2024 14:24
asdf php 8.2.0 build dependencies in ubuntu 24.04 lts
!#/bin/bash
sudo apt install pkg-config autoconf g++ libmcrypt-dev bison libbison-dev \
re2c build-essential libxml2-dev sqlite3 libsqlite3-dev libssl-dev zlib1g-dev \
libreadline-dev libseccomp-dev libcurl4-openssl-dev libjpeg-dev libpng-dev \
libfreetype6-dev libgpm-dev libgd-dev libonig5 libonig-dev libpq-dev libzip-dev