Skip to content

Instantly share code, notes, and snippets.

View robertsheacole's full-sized avatar

Shea Cole robertsheacole

  • Randall Reilly
  • Tuscaloosa, AL
View GitHub Profile
@robertsheacole
robertsheacole / location-information.js
Last active July 16, 2018 18:33
Get location information with Javascript
(function () {
fetch('https://ipapi.co/json')
.then(promise => promise.json())
.then(response => {
// Here is an example of using the client's location to run certain logic.
(response.country === "United States") ? console.log(response) : console.warn("not in US!"))
//Remove the line above this and add your code here...!
}
.catch(err => console.warn(err))
})()
anonymous
anonymous / bonfire-title-case-a-sentence.js
Created December 4, 2015 04:47
http://www.freecodecamp.com/robertsheacole 's solution for Bonfire: Title Case a Sentence
// Bonfire: Title Case a Sentence
// Author: @robertsheacole
// Challenge: http://www.freecodecamp.com/challenges/bonfire-title-case-a-sentence
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function titleCase(str) {
//make string lowercase and split into array
var makeArray = str.toLowerCase().split(' ');
//loop through array
for ( var i = 0; i < makeArray.length; i++){