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
| // Add / Update a key-value pair in the URL query parameters | |
| function updateUrlParameter(uri, key, value) { | |
| // remove the hash part before operating on the uri | |
| var i = uri.indexOf('#'); | |
| var hash = i === -1 ? '' : uri.substr(i); | |
| uri = i === -1 ? uri : uri.substr(0, i); | |
| var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); | |
| var separator = uri.indexOf('?') !== -1 ? "&" : "?"; | |
| if (uri.match(re)) { |
| 'use strict'; | |
| // simple express server | |
| var express = require('express'); | |
| var app = express(); | |
| var router = express.Router(); | |
| app.use(express.static('public')); | |
| app.get('/', function(req, res) { | |
| res.sendfile('./public/index.html'); |
| <html> | |
| <body> | |
| <!-- load combined svg file (with symbols) into body--> | |
| <script> | |
| (function (doc) { | |
| var scripts = doc.getElementsByTagName('script') | |
| var script = scripts[scripts.length - 1] | |
| var xhr = new XMLHttpRequest() | |
| xhr.onload = function () { |
| # show all changes of a file, work even if the file is deleted | |
| git log -- docroot/user_bars/logo.png | |
| # limit the output of Git log to the last commit, i.e. the commit which delete the file | |
| # -1 to see only the last commit | |
| # use 2 to see the last 2 commits etc | |
| git -1 log -- docroot/user_bars/logo.png | |
| # view the content of the file in a specific commit; note that the file is not deleted in that commit | |
| git show f5ac172e docroot/user_bars/logo.png |
| <!-- For iPad with high-resolution Retina display running iOS ≥ 7: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="152x152" href="apple-touch-icon-152x152-precomposed.png"> | |
| <!-- For iPad with high-resolution Retina display running iOS ≤ 6: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png"> | |
| <!-- For iPhone with high-resolution Retina display running iOS ≥ 7: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="120x120" href="apple-touch-icon-120x120-precomposed.png"> | |
| <!-- For iPhone with high-resolution Retina display running iOS ≤ 6: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png"> | |
| <!-- For the iPad mini and the first- and second-generation iPad on iOS ≥ 7: --> | |
| <link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76-precomposed.png"> |
| # There are 3 levels of git config; project, global and system. | |
| # project: Project configs are only available for the current project and stored in .git/config in the project's directory. | |
| # global: Global configs are available for all projects for the current user and stored in ~/.gitconfig. | |
| # system: System configs are available for all the users/projects and stored in /etc/gitconfig. | |
| # Create a project specific config, you have to execute this under the project's directory. | |
| $ git config user.name "John Doe" | |
| # Create a global config |
| #!/usr/bin/env node | |
| /* | |
| * Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
| * Modified from https://gist.github.com/paolorossi/1993068 | |
| */ | |
| var http = require('http') | |
| , fs = require('fs') | |
| , util = require('util') |
| ;(function(define){define(function(require,exports,module){ | |
| //... | |
| });})(typeof define=='function'&&define.amd?define | |
| :(function(n,w){'use strict';return typeof module=='object'?function(c){ | |
| c(require,exports,module);}:function(c){var m={exports:{}};c(function(n){ | |
| return w[n];},m.exports,m);w[n]=m.exports;};})('module-name',this)); |
| /** | |
| * This file/module contains all configuration for the build process. | |
| */ | |
| /** | |
| * Load requires and directory resources | |
| */ | |
| var join = require('path').join, | |
| bowerrc = JSON.parse(require('fs').readFileSync('./.bowerrc', {encoding: 'utf8'})), | |
| bowerJSON = bowerrc.json.replace(/^\.?\/?/, './'), |