Skip to content

Instantly share code, notes, and snippets.

Avatar

Eduardo Vieira edgvi10

  • Amora Sistemas, Link Informática RJ
  • Rio de Janeiro
View GitHub Profile
@edgvi10
edgvi10 / commands.sh
Last active Apr 30, 2022
NextJS project Pack
View commands.sh
npm i next react react-dom axios serverless-mysql md5 uuidv4 cors localforage date-fns sass
mkdir public src styles
mkdir public/assets src/pages src/libs src/services src/components
mkdir src/components/templates src/components/layouts src/pages/api
mkdir src/pages/api/frontend src/pages/api/dashboard
@codeguy
codeguy / slugify.js
Created Sep 24, 2013
Create slug from string in Javascript
View slugify.js
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}