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 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"); |
/* | |
* 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 = [] |
const fs = require('fs') | |
const { sequelize } = require('./api/db/models') | |
const { models } = sequelize | |
function toSnakeCase(str, upper) { | |
if (str.split().every(s => s.toLowerCase() === s)) return str | |
const snake = str.replace(/([A-Z])/g, $1 => `_${$1.toLowerCase()}`) |
const { parse } = require('acorn'); | |
const fs = require('fs'); | |
const file = fs.readFileSync('./__tests__/file-name.js').toString(); | |
const rootAST = parse(file, { | |
locations: true | |
}); | |
function traverse(ast) { | |
if (Array.isArray(ast)) { | |
for (let i = 0; i < ast.length; i++) { |
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master
branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Remove the dist
directory from the project’s .gitignore
file (it’s ignored by default by Yeoman).
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples |