Skip to content

Instantly share code, notes, and snippets.

View Nekall's full-sized avatar
💾
Hard worker 💪 👨‍💻

Neka Nekall

💾
Hard worker 💪 👨‍💻
View GitHub Profile
@Nekall
Nekall / dirname.mjs
Created October 4, 2023 13:11
Marre de redéclarer le __dirname partout.
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
export const __dirname = join(dirname(fileURLToPath(import.meta.url)), '..') // '..' dans le cas ou il est dans un dossier utils par exemple
// Hack for https://memory-game-elieb77.vercel.app/
// Just copy and paste the code into the console after clicking on "Play".
console.clear()
console.info("Neka Hack2000 - Memory Game init....");
let cards = document.querySelectorAll("div[class^='styles___card__']");
let backCards = document.querySelectorAll("div[class^='styles___back']");
let imagesUrls = [];
let identifications = [];
echo Welcome to the automatic setup of a Reactjs app by Neka ✨
echo ⚠️ The name of your application must be in miniscule and the words separated by dashes, for example: my-app
echo What do you want to name your application ?
read name
echo Creation of the $name application, in progress 🛠️
npx create-react-app $name --template typescript && cd $name/ && npm uninstall web-vitals && npm uninstall @testing-library/jest-dom && npm uninstall @testing-library/react && npm uninstall @testing-library/user-event && npm i react-router-dom && sed -i '/eject/d' package.json && sed -i '/test/d' package.json && sed -i '/jest/d' package.json && sed -i '/reportWebVitals/d' src/index.tsx && sed -i '/CRA-vitals/d' src/index.tsx && sed -i '/measuring performance/d' src/index.tsx && sed -i '/"build": "react-scripts build",/c\ "build": "react-scripts build"' package.json && sed -i '/"react-app",/c\ "react-app"' package.json && npm i sass && mkdir src/assets && mkdir src/assets/fonts && mkdir src/assets/images && mkdir src/