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
| // once in the headers | |
| defineMetaEvent('Namespace','Click'); | |
| // then when you need it | |
| document.body.onNamespaceClick.add(function(e) { /*...*/ }); | |
| document.body.onNamespaceClick.clear(); |
| { | |
| "name": "my-app", | |
| "version": "1.0.0", | |
| "description": "My test app", | |
| "main": "src/js/index.js", | |
| "scripts": { | |
| "jshint:dist": "jshint src/js/*.js", | |
| "jshint": "npm run jshint:dist", | |
| "jscs": "jscs src/*.js", | |
| "browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js", |
| var url = "http://example.com:3000/pathname/?search=test#hash"; | |
| var _a = new URL(url); | |
| _a.protocol; // => "http:" | |
| _a.hostname; // => "example.com" | |
| _a.port; // => "3000" | |
| _a.pathname; // => "/pathname/" | |
| _a.search; // => "?search=test" | |
| _a.hash; // => "#hash" |
| # 內容 | |
| # repo 位置 | |
| - https://github.com/facebook/react | |
| - https://github.com/facebook/flux | |
| # 官網 | |
| - React | |
| * http://facebook.github.io/react/ |
| /** | |
| * VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
| * | |
| * To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
| * It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
| * the height of element `.foo` —which is a full width and height cover image. | |
| * | |
| * iOS Resolution Quick Reference: http://www.iosres.com/ | |
| */ | |
| // Get binary file using XMLHttpRequest | |
| function getBinary(file) { | |
| var xhr = new XMLHttpRequest(); | |
| xhr.open("GET", file, false); | |
| xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
| xhr.send(null); | |
| return xhr.responseText; | |
| } | |
| // Base64 encode binary string |
| /* | |
| source: http://unlimited.kptaipei.tw/docs/ | |
| ref: http://lea.verou.me/2012/04/background-attachment-local/ | |
| demo by @Lea Verou | |
| http://dabblet.com/gist/2462915 | |
| */ | |
| %scroll-shadow--vertical { | |
| background-image: | |
| /* Shadow covers */ |
| /*! | |
| * The simple JS URI object. | |
| * | |
| * @license GNU General Public License version 2 or later; see LICENSE | |
| * @link https://gist.github.com/asika32764/6556efdf5c593ce140bb | |
| */ | |
| /** | |
| * The simple JS URI object. | |
| * |
| // via: | |
| // * https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations/Detecting_CSS_animation_support | |
| // * https://gist.github.com/jackfuchs/556448 | |
| $.support.cssProperty = function(prop) { | |
| var domPrefixes = ',Webkit,Moz,O,ms,Khtml'.split(','), | |
| domPrefixesLength = domPrefixes.length, | |
| isSupport = false; | |
| for (var i = 0; i < domPrefixesLength; i++) { | |
| // i = 0, standard method, do not trans to uppercase |