A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
// validate email, portuguese mobile, dates, and portuguese postal code | |
email.match( /([0-9a-zA-Z]+[\-._+&])*[0-9a-zA-Z]+@([\-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}/ ); | |
portuguese_mobile.match( /^([3]\d{8})|([2]\d{8})|([9][1|2|3|4|6]\d{7})$/ ); | |
date.match( /(\d{4}|(0[1-9]|[12][0-9]|3[01]))[\s\-\/](0[1-9]|1[012])[\s\-\/]((\d{4})|(0[1-9]|[12][0-9]|3[01]))/ ); | |
portuguese_postal_code.match( /^\d{4}(-\d{3})?$/ ); |
function isImageLoaded(image, $elem){ | |
if(!image.complete){ | |
requestAnimationFrame($.proxy(this.isImageLoaded, this, image, $elem)); | |
}else{ | |
$elem.removeClass('loading'); | |
$elem.data("loaded", "true"); | |
} | |
} |
// on windows | |
// kill all instances of node | |
taskkill /f /im node.exe | |
////////////////////////// | |
// list all the processes on port 3000 | |
netstat -ano | find "LISTENING" | find "3000" | |
// kill process 14828 |
/*! | |
* Copyright 2015 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
(function() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
// Straightforward + simple. | |
$("button").on("click", function(event) { | |
event.preventDefault(); | |
var button = $(this); | |
var numberElem = button.find(".number"); | |
var number = Number(numberElem.text()) - 1; | |
numberElem.text(number); | |
if (number === 0) { | |
button.prop("disabled", true); | |
button.off("click"); |
npm adduser --scope@company | |
npm init --scope=company | |
npm publish | |
// have not used this line but it grant access to a user | |
npm access grant read-only comapny:developers @company/wds-ckeditor4 |
git gc --prune=now
git remote prune origin