Skip to content

Instantly share code, notes, and snippets.

View oussla's full-sized avatar

Nicolas Lagarde oussla

View GitHub Profile
@oussla
oussla / css-selectors-count.js
Created December 7, 2020 18:22
CSS Selectors Count
/**
CSS Selectors Count
Count the total number of CSS selectors and provide grand total.
To be run on DevTools console.
From https://stackoverflow.com/a/12313690/1310132
*/
var
styleSheets = document.styleSheets,
totalStyleSheets = styleSheets.length,
@oussla
oussla / pre-commit-eslint
Last active December 2, 2020 20:41 — forked from shettayyy/pre-commit-eslint
Pre-commit hook for linting staged .js, .jsx or .vue files with ESLint before commit.
#!/bin/sh
#
# Pre-commit hook for linting staged javascript files with ESLint
# From https://gist.github.com/rashtay/328da46a99a9d7c746636df1cf769675
#
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$\|.vue$")
ESLINT="node_modules/.bin/eslint"
printf "\nPre-commit hook: ESLint javascript validation\n"
@oussla
oussla / loadtimes.js
Created September 1, 2017 14:26
LoadTimes – Simple function to calculate the various load times available in window.chrome.loadTimes()
/**
LoadTimes
Simple function to calculate the various load times available in window.chrome.loadTimes().
Rounds values as milliseconds, relatives to "startLoadTime".
Result is stored on clipboard.
*/
console.info("LoadTimes");