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
| Warden::Manager.serialize_into_session{|user| user.id } | |
| Warden::Manager.serialize_from_session{|id| User.get(id) } | |
| Warden::Manager.before_failure do |env,opts| | |
| # Sinatra is very sensitive to the request method | |
| # since authentication could fail on any type of method, we need | |
| # to set it for the failure app so it is routed to the correct block | |
| env['REQUEST_METHOD'] = "POST" | |
| end | |
| %h1#headings Headings | |
| %h1 Heading 1 | |
| %h2 Heading 2 | |
| %h3 Heading 3 | |
| %h4 Heading 4 | |
| %h5 Heading 5 | |
| %h6 Heading 6 | |
| %hr | |
| %h1#headings-with-text Headings with Text |
| // disable :hover on touch devices | |
| // based on https://gist.github.com/4404503 | |
| // via https://twitter.com/javan/status/284873379062890496 | |
| // + https://twitter.com/pennig/status/285790598642946048 | |
| // re http://retrogamecrunch.com/tmp/hover | |
| // NOTE: we should use .no-touch class on CSS | |
| // instead of relying on this JS code | |
| function removeHoverCSSRule() { | |
| if ('createTouch' in document) { | |
| try { |
| #!/bin/bash -e | |
| ## split-image.sh - Split a large image into same-size tiles | |
| ## Split a large image into same-size tiles | |
| ## and optionally convert to a print-ready PDF document | |
| ## | |
| ## For example split a huge A1-size banner into 8x A4 tiles | |
| ## and create a single PDF ready for print. |
| // ----------------------------------------------------------------------- | |
| // 100% Mixin | |
| // ----------------------------------------------------------------------- | |
| @mixin cover-all { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; |
| (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(": "); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <h2>Original CSS</h2> | |
| <style style="display: block; white-space: pre; font-family: monospace"> | |
| h2 { margin:0; } |
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('express') | |
| , routes = require('./routes') | |
| , user = require('./routes/user') | |
| , http = require('http') | |
| , path = require('path') |
| var gulp = require('gulp'), | |
| gutil = require('gulp-util'), | |
| sass = require('gulp-sass'), | |
| csso = require('gulp-csso'), | |
| uglify = require('gulp-uglify'), | |
| jade = require('gulp-jade'), | |
| concat = require('gulp-concat'), | |
| livereload = require('gulp-livereload'), | |
| premailer = require('gulp-premailer'), | |
| tinylr = require('tiny-lr'), |