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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
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
function isIsogram(str){ | |
console.log( 'string: ' + str ); | |
// length of the string | |
var stringLength = str.length; | |
console.log( 'stringLength: ' + stringLength ); | |
// if the string is empty then it is considered an isogram | |
if ( stringLength == 0 ) { |
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
function XO(str) { | |
// make the string lowercase because we are case insensitive | |
str = str.toLowerCase(); | |
// put the string into an array | |
var arrayOfCharacters = str.split(""); | |
//count the x's | |
var countX = arrayOfCharacters.reduce( function( n, val ) { |
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
function findNb(m) { | |
// create an endless loop that increments n, the cube number, starting with a value of 1 | |
for ( var n = 0;;n++ ) { | |
if ( m > 0 ) { | |
// if m, the total volume, is not 0, we will subtract the volume of the current cube from it | |
// first calculate the volume of the current cube | |
var currCubeVol = Math.pow( n+1, 3); | |
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
function calculateYears(principal, interest, tax, desired) { | |
// create an endless loop that will increment the number of years | |
for ( var year = 0;; year++ ) { | |
// check if the principal has reached the desired amount | |
if ( principal >= desired ) { | |
return year; | |
} | |
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
// make a loop that goes from 1 to 100 | |
for ( var num = 1; num < 101; num ++ ) { | |
// check if the number is divisible by 3 or 5 | |
var checkForThree = num % 3; | |
var checkForFive = num % 5; | |
// if the number is divisible by both 3 and 5, then print FizzBuzz | |
if ( (checkForThree == 0) && (checkForFive == 0) ) | |
console.log( "FizzBuzz"); |
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
// Set the grid size | |
var size = 8; | |
// set a variable for the grid output string | |
var gridOutput = ""; | |
// set a variable for the row output string | |
var rowOutput = ""; | |
// set variables for the things that make up the grid |
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
// compare firstNum and secondNum and return the smaller of the two | |
function min( firstNum, secondNum ) { | |
if ( firstNum < secondNum ) | |
return firstNum; | |
else | |
return secondNum; | |
} | |
console.log(min(0, 10)); | |
// → 0 |
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
// Recursive function to determine if a number is even | |
function isEven( checkNum ) { | |
// if the number is negative then convert it to positive | |
if ( checkNum < 0 ) | |
checkNum *= -1; | |
// if the number is zero then it's even | |
if ( checkNum == 0 ) { | |
result = 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
// range function | |
function range( start, end, increment ) { | |
// create the result array | |
var result = []; | |
// test to see if we have an increment, otherwise set it to 1 | |
if ( increment == undefined ) | |
increment = 1; | |
OlderNewer