As always, a WIP.
- JS Lint
- CSS Prefixer
- Minify
- Image Optimize (ImageOptim)
- jQuery CDN (Google)
- HTML Validation
#!/usr/bin/env ruby | |
# ./canada.rb amateur.txt | |
Fields = %w{call first_name last_name address city postal_code license} | |
puts Fields.join ',' | |
open(ARGV[0],:encoding=>"ISO8859-1").each_line.map{|l| | |
p = (case l.size | |
when 212 then | |
l.match /^(?<call>.{7})(?<first_name>.{36})(?<last_name>.{36})(?<address>.{71})(?<city>.{36})(?<postal_code>.{14})(?<license>.{10})/ | |
when 471 then |
<?php | |
public function subscribeEvents() { | |
Backend::$events->addEvent('shop:onExtendProductModel', $this, 'extend_product_model'); | |
Backend::$events->addEvent('shop:onExtendProductForm', $this, 'extend_product_form'); | |
Backend::$events->addEvent('shop:onOverrideProductCsvExportColumns', $this, 'set_product_csv_export_columns'); | |
Backend::$events->addEvent('shop:onOverrideProductCsvImportData', $this, 'set_product_csv_import_data'); | |
} |
function xViewState() { | |
var a = 0, | |
x = [ | |
'9091968376', | |
'8887918192818786347374918784939277359287883421333333338896', | |
'877886888787', | |
'949990793917947998942577939317' | |
], | |
l = x.length, |
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 ($) { | |
'use strict'; | |
$.fn.outerHTML = function (s) { | |
return s | |
? this.before(s).remove() | |
: $("<p>").append(this.eq(0).clone()).html(); | |
}; | |
}(this.jQuery)); |
// Usage: | |
// $('.unevenheights').setAllToMaxHeight(); | |
;(function ($) { | |
'use strict'; | |
$.fn.setAllToMaxHeight = function () { | |
return this.height(Math.max.apply(this, $.map( this , function (e) { return $(e).height() }) ) ); | |
} | |
}(jQuery)); |
<?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 |
<?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); |
/** | |
* 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); |