Blog


In JavaScript Show Longest Word in a String
Posted on November 28, 2017 in Algorithms, JavaScript, Regular Expressions by Matt Jennings

function longestWord(sen) {
// ‘sen’ is a string and ‘match’
// matches all the items in the …

Read more


Determine If a Positive Integer is a Prime Number Using JavaScript
Posted on November 27, 2017 in Algorithms, JavaScript by Matt Jennings

function getPrimeNumber(num) {

var arr = [];

for(var i = 1; i < num + …

Read more


WordPress PHP and MySQL Code Cheat Sheet
Posted on November 17, 2017 in PHP, WordPress by Matt Jennings

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php the_content(); ?>

<?php endwhile; endif; ?>

<h2 class=”clear”>Featured Projects</h2>

Read more


In JavaScript Reverse a String without using reverse()
Posted on November 12, 2017 in Algorithms, JavaScript by Matt Jennings

var str = ‘blah’;

function reverseStr(str1) {
var arr1 = str1.split(”);
var arr2 = [];

Read more


Execute JS by URL
Posted on October 25, 2017 in JavaScript by Matt Jennings

var pageUrl = window.location.href;

if(pageUrl.toLocalLowerCase().indexOf(‘mattjennings.net/blog’) != -1) {
// JS to execute here
}

var pageUrl = window.location.href;

if(pageUrl.toLocalLowerCase().indexOf(‘mattjennings.net/blog’) == -1) {

Read more