Skip to content

Instantly share code, notes, and snippets.

View vladdu's full-sized avatar

Vlad Dumitrescu vladdu

  • Göteborg, Sweden
View GitHub Profile
@vladdu
vladdu / 0_reuse_code.js
Created July 28, 2014 12:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/bin/sh
#
# A (client-side) git hook script which warns if there are too long lines in
# the commit message, not fitting with 50/72 formatting.
#
# To use this script, copy it as .git/hooks/commit-msg and give it an executable
# file permission.
#
FILE=$1
@vladdu
vladdu / main.js
Last active January 25, 2022 18:54 — forked from kdzwinel/main.js
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.