CSS loader animation.
Is there a way to condense the HTML/CSS so it works with an arbitrary number of loading bars?
var currentScript = document.scripts[document.scripts.length - 1]; | |
var container = document.createElement("div"); | |
container.appendChild(document.createTextNode("CREATIVE")); | |
currentScript.parentNode.insertBefore(container, currentScript); |
// https://facebook.github.io/react/docs/thinking-in-react.html | |
var React = require('react'); | |
var ReactDOM = require('react-dom'); | |
var ProductCategoryRow = React.createClass({ | |
render: function() { | |
return( | |
<tr> | |
<th colSpan="2"> |
<?php | |
/** | |
* CareerCup min range. | |
* | |
* This is NOT a working solution. By dumb luck it happened to solve the problem | |
* for the example lists, but completely crumbles when presented with: | |
* - more than 3 lists. | |
* - sadistic lists like: | |
* array(0, 1, 2, 3, 4) | |
* array(5, 6, 7, 8, 9) |
<?php | |
// Found here: http://alexking.org/speaking/core-competency/index.php#/queries-04-wp-query-modifiers | |
$example = new WP_Query(array( | |
'posts_per_page' => 2, | |
'orderby' => 'date', | |
'order' => 'DESC', | |
'no_found_rows' => true, | |
'update_post_term_cache' => false, | |
'update_post_meta_cache' => false, |
<?php | |
// Requires PHP 5.3+ | |
// Found here: http://stackoverflow.com/a/1320156 | |
function flatten_array(array $array) { | |
$flattened_array = array(); | |
array_walk_recursive($array, function($a) use (&$flattened_array) { $flattened_array[] = $a; }); | |
return $flattened_array; | |
} |
/** | |
* Resizes the canvas for high DPI (retina) screens. | |
* | |
* Modified from here: http://www.html5rocks.com/en/tutorials/canvas/hidpi/ | |
* | |
* By Paul Lewis, customized by Mike Kohn | |
*/ | |
var HDPICanvas = (function() { | |
function scale(canvas) { |
function str_to_slug(str, sep) { | |
if (typeof sep == 'undefined') { | |
sep = '-'; | |
} | |
// remove extra spaces and convert to lowercase | |
str = str.toString().trim().toLowerCase(); | |
// convert any character that's not alphanumeric into a separator | |
str = str.replace(/[^a-z0-9]/g, sep) | |
// replace any successive separators with a single one |
<?php | |
add_filter('show_post_locked_dialog', '__return_false'); |
<?php | |
function pre_print($var, $title="", $return=false) { | |
$output = ""; | |
$output .= ($title) ? '<strong>'.$title.'</strong>' : ""; | |
$output .= '<pre>'; | |
$output .= print_r($var, true); | |
$output .= '</pre>'; | |
if($return) { |