One of many ways in which to achieve fancy checkboxes. Can do the same for radio buttons by changing the input type as needed and updating styles.
A Pen by Tiffany Brown on CodePen.
/* | |
Split an array into chunks and return an array | |
of these chunks. | |
With kudos to github.com/JudeQuintana | |
This is an update example for code I originally wrote 5+ years ago before | |
JavaScript took over the world. | |
Extending native objects like this is now considered a bad practice, so use |
const numberFormat = (number, separator = ',') => { | |
const num = Number.isNaN(+number) ? 0 : +number; | |
let x = 0; | |
let fnum = []; | |
const digits = (num + '').split(''); | |
const seg = digits.length / 3; | |
while(x < seg){ | |
fnum[x] = digits.splice(-3).join(''); |
One of many ways in which to achieve fancy checkboxes. Can do the same for radio buttons by changing the input type as needed and updating styles.
A Pen by Tiffany Brown on CodePen.
// Removes the # from hexRGB colors for use in SVG data URIs | |
@function removeHash($hexColor){ | |
$hexColor: $hexColor + ''; // Convert to a string | |
$colorNum: str-slice($hexColor,2); | |
@return $colorNum; | |
} | |
// Sample usage | |
@mixin check($fillColor) { | |
$noHashColor: removeHash($fillColor); |
<?php | |
function factorial($num){ | |
$rng = range(1,$num); | |
return array_product($rng); // array_product function requires PHP5.1.0+ | |
} | |
print factorial(10); // 3628800 |
<?php | |
/* | |
Add this code to functions.php. Then add Woothemes' FlexSlider to your templates | |
as you otherwise would. | |
Rewrite 29 September 2014 to use WordPress filters instead of overwriting the | |
shortcode handler. | |
*/ |
<?php | |
/* | |
* Designed to be used on the command line. | |
* php genpass.php [arg1] [arg2] ... | |
* Accepts up to three parameters: | |
* --length or -l = length of the password | |
* --specialchars or -s = whether to include punctuation in generating the password | |
* --unique or -u = whether to prevent repeated characters in a string | |
* | |
*/ |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^/$ /content/ [L] | |
RewriteRule ^(.*)$ /content/$1 [L] | |
</IfModule> | |
# END WordPress |