As always, a WIP.
- JS Lint
- CSS Prefixer
- Minify
- Image Optimize (ImageOptim)
- jQuery CDN (Google)
- HTML Validation
| #!/usr/bin/env ruby | |
| # Check DNS records against two authoritative nameservers | |
| # usage: $ ruby record-checker.rb --input_file record-checker.csv --nameserver nina.ns.cloudflare.com | |
| # | |
| # Example output: | |
| # | |
| # | TYPE | RECORD | CURRENT | @NINA.NS.CLOUDFLARE.COM | |
| # --|-------|--------------------------------|--------------------------------|------------------------------- | |
| # ✗ | A | www.matternow.com | 45.56.118.101 | matternow.com. |
| <?php | |
| // Settings used for local development | |
| // do NOT track in your repository for deployment | |
| /** | |
| * Following 2 lines overwrite the standard WP_HOME and WP_SITEURL in the | |
| * wp_options table of the database. Doesn't solve all problems, but any | |
| * URL's generated dynamically (You are using site_url('', 'relative'), aren't you?!) | |
| * will generate correctly. |
| /** | |
| * Helps for anything we're going to be animating. Makes a HUGE | |
| * difference | |
| * | |
| * Performance tweaks found here: | |
| * http://blog.teamtreehouse.com/increase-your-sites-performance-with-hardware-accelerated-css | |
| * | |
| * NOTE: You'll want to use autoprefixer with this, otherwise you need to add the appropriate vendor prefixes | |
| * | |
| * -webkit-transform: translate3d(0, 0, 0); |
| <?php | |
| // Useage looks like: trace_log($awesomeVar); | |
| if (!function_exists('trace_log')) { | |
| function trace_log ($log) { | |
| if (true === WP_DEBUG) { | |
| if (is_array($log) || is_object($log)) { | |
| error_log(print_r($log, true)); | |
| } else { | |
| error_log($log); |
| <?php | |
| // Useage: <a href="<?php category_link('prwhiteboard') ?>">PR Whiteboard</a> | |
| if (!function_exists('category_link')) { | |
| function category_link($slug) { | |
| $cat = get_category_by_slug($slug); | |
| $id = $cat->term_id; | |
| // If the theme implements the relative URL filtering provided by the roots | |
| // starter theme, let's filter the output first so everything is squeaky clean |
| // Usage: | |
| // $('.unevenheights').setAllToMaxHeight(); | |
| ;(function ($) { | |
| 'use strict'; | |
| $.fn.setAllToMaxHeight = function () { | |
| return this.height(Math.max.apply(this, $.map( this , function (e) { return $(e).height() }) ) ); | |
| } | |
| }(jQuery)); |
| ;(function ($) { | |
| 'use strict'; | |
| $.fn.outerHTML = function (s) { | |
| return s | |
| ? this.before(s).remove() | |
| : $("<p>").append(this.eq(0).clone()).html(); | |
| }; | |
| }(this.jQuery)); |
| function fillForm(formSelector, data) { | |
| $.each(data, function (name, val) { | |
| var | |
| $el = $(formSelector + ' [name="' + name + '"]'), | |
| type = $el.attr('type'); | |
| switch (type) { | |
| case 'checkbox': | |
| $el.attr('checked', 'checked'); | |
| break; |
| function xViewState() { | |
| var a = 0, | |
| x = [ | |
| '9091968376', | |
| '8887918192818786347374918784939277359287883421333333338896', | |
| '877886888787', | |
| '949990793917947998942577939317' | |
| ], | |
| l = x.length, |