Skip to content

Instantly share code, notes, and snippets.

@othmanjabes
othmanjabes / getAllUrlParams.js
Last active September 4, 2024 11:52
function to give you all the URL parameters as a neat object:
function getAllUrlParams(url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
@othmanjabes
othmanjabes / eslint-config-airbnb.js
Created November 14, 2022 15:28 — forked from Boghdady/eslint-config-airbnb.js
Eslint airbnb configrations for nodejs projects
// 1- Install these packages in your dev dependencies using this command:
npm i -D eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-node eslint-plugin-prettier eslint-plugin-react prettier
// 2- Create ".eslintrc.json" file in the root directory with these configration:
{
"extends": ["airbnb", "prettier", "plugin:node/recommended"],
"plugins": ["prettier"],