Skip to content

Instantly share code, notes, and snippets.

View xstable's full-sized avatar

Samuel Suther xstable

View GitHub Profile
@xstable
xstable / FormControls.js
Created February 14, 2018 13:40
FormControls.js
// formcontrols.js
// https://github.com/bgrins/devtools-snippets
// Print out forms and their controls
(function() {
var forms = document.querySelectorAll("form");
for (var i = 0, len = forms.length; i < len; i++) {
var tab = [ ];
@xstable
xstable / cacheBuster.js
Created February 14, 2018 13:39
cacheBUSTER
// Cache Buster
// https://bgrins.github.io/devtools-snippets/#cachebuster
// Overwrite all link and (optionally) script tags by adding Date.now() at the end of href and src attributes, respectively.
// By default processing scripts is not performed, you should change the variable process_scripts to true to run these.
(function (){
var rep = /.*\?.*/,
links = document.getElementsByTagName('link'),
scripts = document.getElementsByTagName('script'),
process_scripts = false;
@xstable
xstable / fontAwesomeGetUnicodeString.js
Created February 14, 2018 13:38
FontAwesome_getUnicodeString
/**
* Samuel Suther info@suther.de
* 2016-03-08
* This Sippet open a Confirm-Dialog. Input the Unicode. Result appear in a Textarea.
* This way, you can copy the String and enter an new Unicode directly if needed.
*/
var faIcons = {
"adjust": "f042",
"adn": "f170",
@xstable
xstable / aboveTheFoldCss.js
Created February 14, 2018 13:35
aboveTheFoldCss (Critical Path CSS Generator)
/**
* Simple Critical CSS and Full CSS extraction widget
*
* @usage
* Copy & paste this widget in the browser console and use the following methods with an optional callback.
*
* window.extractCriticalCSS( callback );
* window.extractFullCSS( callback );
*
* When no callback is provided, the extracted CSS is offered as a file download + printed to the browser console.
@xstable
xstable / loadJquery.js
Created February 14, 2018 13:34
load jQuery (latest)
javascript: (function(e, s) {
e.src = s;
e.onload = function() {
// If noConflict is need, uncomment the following Line and use jQuery.('body')... for example instead of $.('body')...
//jQuery.noConflict();
console.log('jQuery injected');
};
document.head.appendChild(e);
})(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js');