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 palindrome(str) { | |
// Good luck! | |
var re = /[\s\!\@\#\$\%\^\&\*\(\)\+\=\-/\\\\:\_]/g, | |
cleanStr, | |
revStr; | |
cleanStr = str.toLowerCase().replace(re, ""); | |
revStr = cleanStr.split("").reverse().join(""); | |
if (cleanStr === revStr) { | |
return true; | |
} else { console.log(cleanStr); } |
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
"use strict"; | |
var upper = 10000, | |
numToGuess = getRandomNumber(upper), | |
compGuess, | |
numOfGuesses = 0; | |
function getRandomNumber(upper) { | |
return Math.floor( Math.random() * upper ) + 1; | |
} |
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
"use strict"; | |
var upper = 10000, | |
numToGuess = getRandomNumber(upper), | |
compGuess = getRandomNumber(upper), | |
numOfGuesses = 0, | |
correctGuess = false; | |
function getRandomNumber(upper) { | |
return Math.floor( Math.random() * upper ) + 1; |
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
/* If you have a sticky bar at the top of a webpage that's the same color as the page background, this will fade in a drop shadow below the bar to create a boundary on scroll */ | |
// jQuery | |
$(document).ready(function(){ | |
var a=$(".sticky-top-bar"); | |
$(window).scroll(function(){ | |
if($(document).scrollTop()>50){a.addClass("top-bar-shadow") | |
}else{a.removeClass("top-bar-shadow")}})}); | |
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
/* @import url('http://example.com/example_style.css'); */ | |
/** | |
* CSS @imports must be at the top of the file. | |
* Add them above this section. | |
*/ | |
/* ========================================================================== |
NewerOlder