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
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div> | |
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" /> | |
<script type="text/javascript"> | |
var appendConsole = function(message, type) { | |
var color = "black"; | |
if (type === "error") { | |
color = "red"; | |
} else if (type === "debug") { |
function $$(xpath,root) { | |
2 xpath = xpath | |
3 .replace(/((^|\|)\s*)([^/|\s]+)/g,'$2.//$3') | |
4 .replace(/\.([\w-]+)(?!([^\]]*]))/g, '[@class="$1" or @class$=" $1" or @class^="$1 " or @class~=" $1 "]') | |
5 .replace(/#([\w-]+)/g, '[@id="$1"]') | |
6 .replace(/\/\[/g,'/*['); | |
7 str = '(@\\w+|"[^"]*"|\'[^\']*\')'; | |
8 xpath = xpath | |
9 .replace(new RegExp(str+'\\s*~=\\s*'+str,'g'), 'contains($1,$2)') | |
10 .replace(new RegExp(str+'\\s*\\^=\\s*'+str,'g'), 'starts-with($1,$2)') |
function memorySizeOf(obj) { | |
var bytes = 0; | |
function sizeOf(obj) { | |
if(obj !== null && obj !== undefined) { | |
switch(typeof obj) { | |
case 'number': | |
bytes += 8; | |
break; | |
case 'string': |
public void ConfigureAuth(IAppBuilder app) | |
{ | |
// ... | |
var linkedInOptions = new LinkedInAuthenticationOptions(); | |
linkedInOptions.ClientId = "Your LinkedIn API Key"; | |
linkedInOptions.ClientSecret = "Your LinkedIn Secret Key"; | |
linkedInOptions.Scope.Add("r_fullprofile"); |
{ | |
"root": true, | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true, | |
"node": true | |
}, | |
"parserOptions": { | |
"ecmaVersion": 6, |
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>brain.js</title> | |
<script src="https://cdn.rawgit.com/BrainJS/brain.js/develop/browser.js"></script> | |
<script> | |
function DrawableCanvas(el) { | |
const px = 10 | |
const ctx = el.getContext('2d') | |
let x = [] |
String.prototype.toProperCase = function (convertCamelCase) { | |
var words = this.split(' '); | |
var proper = []; | |
for (var index in words) { | |
if (convertCamelCase) { | |
proper.push(words[index].replace(/([A-Z])/g, ' $1') | |
.replace(/^./, function (str) { | |
return str.toUpperCase(); | |
})); |