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
| #!/usr/bin/env bash | |
| # help from: | |
| # https://gist.github.com/textarcana/5855427 | |
| # http://tecadmin.net/install-firefox-on-linux/ | |
| # install deps | |
| yum install -y java Xvfb firefox | |
| # This version of FF doesn't actually work with latest selenium (for me) so I remove it again |
| from django.db import models | |
| from wagtail.wagtailsnippets.models import register_snippet | |
| from wagtail.wagtailcore.models import Page | |
| from modelcluster.fields import ParentalKey | |
| from wagtail.wagtailadmin.edit_handlers import InlinePanel | |
| @register_snippet | |
| class Category(models.Model): |
| INITIALISATION | |
| ============== | |
| load wp-config.php | |
| set up default constants | |
| load wp-content/advanced-cache.php if it exists | |
| load wp-content/db.php if it exists | |
| connect to mysql, select db | |
| load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
| load wp-content/sunrise.php if it exists (multisite only) |
| import cv2 | |
| import numpy as np | |
| canny = rho = threshold = minLen = maxGap = None | |
| def draw(): | |
| lines = cv2.HoughLinesP(canny, rho, np.pi / 180, | |
| threshold, None, minLen, maxGap) | |
| dst = cv2.cvtColor(canny, cv2.COLOR_GRAY2BGR) |
| function randomColor(){ | |
| return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")"; | |
| } | |
| function showBoxes(window) { | |
| var rects = []; | |
| function getRects(node){ | |
| var range = window.document.createRange(); | |
| range.setStartBefore(node); | |
| range.setEndAfter(node); |
| // EDIT: 2013/10/20 | |
| // google has updated its kwt UI, this script doesn't work any more! | |
| // may be I will update this script when I have time to investigate their new Interface. | |
| // requires | |
| var utils = require('utils'); | |
| var casper = require('casper').create() | |
| var casper = require('casper').create({ | |
| verbose: true, |
| # EDIT: 2013/10/20 | |
| # google has updated its kwt UI, this script doesn't work any more! | |
| # may be I will update this script when I have time to investigate their new Interface. | |
| from selenium import webdriver | |
| from selenium.common.exceptions import TimeoutException | |
| import selenium.webdriver.support.wait | |
| selenium.webdriver.support.wait.POLL_FREQUENCY = 0.05 | |
| import re |
| from django.db.models.signals import post_init | |
| def track_data(*fields): | |
| """ | |
| Tracks property changes on a model instance. | |
| The changed list of properties is refreshed on model initialization | |
| and save. | |
| >>> @track_data('name') |