This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const upperCaseWords = sentence => sentence.split(' ').map(w => w[0] + w.substr(1).toLowerCase()).join(' '); | |
var sentence = 'EASY TRACK IS YOUR KEY TO AFFORDABLE ORGANIZATION'; | |
var upperCase = upperCaseWords(sentence); | |
console.log(upperCase); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puzzle1 = message => { | |
const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
return message.split('').map(c => { | |
if (c === ' ' || c === '.') { | |
return c; | |
} | |
const position = alphabet.indexOf(c); | |
let newPosition = (position - 13 < 0) ? position + 13 : position - 13; | |
return alphabet[newPosition]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// one liner | |
let digits = num => parseInt((''+num).split('').map(n => n*n).join('')); | |
// cleaned up a little bit | |
let squareDigitsString = num => (''+num).split('').map(n => n*n).join(''); | |
let squareDigits = parseInt(squareDigitsString); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IT'S SHOWTIME | |
TALK TO THE HAND "Where's the Buffet?" | |
TALK TO THE HAND "Hot Damn" | |
TALK TO THE HAND "Pansy Immune System" | |
TALK TO THE HAND "Upper Football" | |
TALK TO THE HAND "William Butterfield" | |
TALK TO THE HAND "Smooth as Silk" | |
TALK TO THE HAND "Black Metal" | |
TALK TO THE HAND "Large Can of Beer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IT'S SHOWTIME | |
HEY CHRISTMAS TREE counter | |
YOU SET US UP 0 | |
HEY CHRISTMAS TREE end | |
YOU SET US UP 1 | |
STICK AROUND end | |
GET TO THE CHOPPER counter | |
HERE IS MY INVITATION counter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include in your header.php file, right before the </head> tag. | |
<?php wp_head(); ?> | |
// include in your footer.php file, right before the </body> tag. | |
<?php wp_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function si_jquery_enqueue() { | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array(), '3.1.1', true ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( !is_admin() ) { | |
add_action( 'wp_enqueue_scripts', 'si_jquery_enqueue', 10 ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function filter_search($query) { | |
if ( $query->is_search ) { | |
$query->set('post_type', array( 'post', 'product' ) ); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts', 'filter_search'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', 'create_product_post_type' ); | |
function create_product_post_type() { | |
register_post_type( 'product', | |
array( | |
'labels' => array( | |
'name' => __( 'Products' ), | |
'singular_name' => __( 'Product' ) | |
), |