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 python | |
| import pynvim, os, re, sys, time | |
| # Get a list of buffers that haven't been deleted. `nvim.buffers` includes | |
| # buffers that have had `:bdelete` called on them and aren't in the buffer | |
| # list, so we have to filter those out. | |
| def get_listed_buffers(nvim): | |
| return set(buf.number for buf in nvim.buffers \ | |
| if nvim.eval('buflisted(%d)' % buf.number)) |
| " Insert into your .vimrc after quick-scope is loaded. | |
| " Obviously depends on <https://github.com/unblevable/quick-scope> being installed. | |
| " Thanks to @VanLaser for cleaning the code up and expanding capabilities to include e.g. `df` | |
| let g:qs_enable = 0 | |
| let g:qs_enable_char_list = [ 'f', 'F', 't', 'T' ] | |
| function! Quick_scope_selective(movement) | |
| let needs_disabling = 0 |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
Google Chrome Developers says:
The new WOFF 2.0 Web Font compression format offers a 30% average gain over WOFF 1.0 (up to 50%+ in some cases). WOFF 2.0 is available since Chrome 36 and Opera 23.
Some examples of file size differences: WOFF vs. WOFF2
| # config/initializers/redcarpet.rb | |
| module ActionView | |
| module Template::Handlers | |
| class Markdown | |
| class_attribute :default_format | |
| self.default_format = Mime::HTML | |
| def call(template) | |
| markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true) | |
| markdown.render(template.source).html_safe.inspect |
| require 'statsd' | |
| $statsd = Statsd.new('your_host_here') | |
| ActiveSupport::Notifications.subscribe /process_action.action_controller/ do |*args| | |
| event = ActiveSupport::Notifications::Event.new(*args) | |
| controller = event.payload[:controller] | |
| action = event.payload[:action] | |
| format = event.payload[:format] || "all" | |
| format = "all" if format == "*/*" | |
| status = event.payload[:status] |
| window.onload = function() { | |
| var v0 = new Vertex("0"); | |
| var v1 = new Vertex("1"); | |
| var v2 = new Vertex("2"); | |
| var v3 = new Vertex("3"); | |
| var v4 = new Vertex("4"); | |
| var v5 = new Vertex("5"); | |
| var v6 = new Vertex("6"); | |
| var v7 = new Vertex("7"); |
| /** | |
| * Monkey patch `Backbone.Model.extend()` with ES5 getters/setters for each | |
| * attribute defined in the defaults. Gives you the added bonus of being | |
| * to pass your backbone models directly to your Mustache.js views. | |
| * | |
| * Example: | |
| * | |
| * var User = Backbone.Model.extend({ | |
| * defaults: { | |
| * username: undefined, |