Skip to content

Instantly share code, notes, and snippets.

View GoesToEleven's full-sized avatar
😀
Enjoy life. Help others.

Todd McLeod GoesToEleven

😀
Enjoy life. Help others.
View GitHub Profile
@GoesToEleven
GoesToEleven / innerhtml
Created July 19, 2015 20:43
javascript innerHTML vs textContent
nodeValue is a little more confusing to use, but faster than innerHTML.
innerHTML parses content as HTML and takes longer.
textContent uses straight text, does not parse HTML, and is faster.
innerText is IE specific and also takes styles into consideration. It won't get hidden text for instance.
http://stackoverflow.com/questions/21311299/nodevalue-vs-innerhtml-and-textcontent-how-to-choose
var request = new XMLHttpRequest();
request.open('GET', 'data.txt');
request.addEventListener('readystatechange', function() {
if ((request.status === 200) && (request.readyState === 4)) {
myNode = document.querySelector('body');
myNode.innerHTML = request.responseText;
console.log('new way');
} //ready
});
[
{
"name":"Barot Bellingham",
"shortname":"Barot_Bellingham",
"reknown":"Royal Academy of Painting and Sculpture",
"bio":"Barot has just finished his final year at The Royal Academy of Painting and Sculpture, where he excelled in glass etching paintings and portraiture. Hailed as one of the most diverse artists of his generation, Barot is equally as skilled with watercolors as he is with oils, and is just as well-balanced in different subject areas. Barot's collection entitled \"The Un-Collection\" will adorn the walls of Gilbert Hall, depicting his range of skills and sensibilities - all of them, uniquely Barot, yet undeniably different"
},
{
"name":"Jonathan G. Ferrar II",
"shortname":"Jonathan_Ferrar",
@GoesToEleven
GoesToEleven / template
Created June 11, 2015 15:44
Using a branch as a template in github
You can use the branch of a project as a template
git clone -b branch_01_02 https://github.com/planetoftheweb/responsivebootstrap.git
@GoesToEleven
GoesToEleven / reconstitute
Created June 11, 2015 15:42
Reconstituting a project in github
$ mkdir FOLDERNAME
$ cd FOLDERNAME
$ git clone --mirror GITURL .git
$ git config --bool core.bare false
$ git reset --hard
@GoesToEleven
GoesToEleven / images
Created June 3, 2015 22:31
image array large images
var images = [
'http://lorempixel.com/output/sports-q-c-1920-1080-1.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-2.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-3.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-4.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-5.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-6.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-7.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-8.jpg',
'http://lorempixel.com/output/sports-q-c-1920-1080-9.jpg',
@GoesToEleven
GoesToEleven / eight-ball
Last active August 29, 2015 14:22
array of eight ball images
var images = [
'https://lh3.googleusercontent.com/pqG6Epu72XBSMeGewWoiBoCeRoOcMPdiDDWkajAqe1s=s675-no',
'https://lh3.googleusercontent.com/OFzmZg-_rAu6olkePkJwIrcG6du8T6YCT4yiUXBEpww=s675-no',
'https://lh3.googleusercontent.com/Pg_DmHxB9xhgU4CaN3z97_qO50pd1Wz9IqgH3SBsD7k=s675-no',
'https://lh3.googleusercontent.com/5OuVJoAhoWvKSJCP8_WiXJLX3bXaFOjQeWiaBYu7flw=s675-no',
'https://lh3.googleusercontent.com/maPR9nqocNzoHof1wMRcRXJHcAf_fAPnrb1mgswcPk8=s675-no',
'https://lh3.googleusercontent.com/PUU9Z3c6xaT2thnHpz-ks7Ny9BhB_70Tle6K_XXFxFE=s675-no',
'https://lh3.googleusercontent.com/8XNr9vm9S9jblDcfiX_vNg_7OoVEacXQW7ZOnnvXWnE=s675-no',
'https://lh3.googleusercontent.com/wDKeeFFvu1tSiNswnHcsxistdlzRfDGX3e0-PEj2Yaw=s675-no',
'https://lh3.googleusercontent.com/U-GJbjXnufAL3hxtQtHwKaaY8O9aY6C5_MmVVOnWPm4=s675-no',
@GoesToEleven
GoesToEleven / imageArray
Created June 3, 2015 16:37
array of image links
var images = [
'http://lorempixel.com/120/120/sports/1/',
'http://lorempixel.com/120/120/sports/2/',
'http://lorempixel.com/120/120/sports/3/',
'http://lorempixel.com/120/120/sports/4/',
'http://lorempixel.com/120/120/sports/5/',
'http://lorempixel.com/120/120/sports/6/',
'http://lorempixel.com/120/120/sports/7/',
'http://lorempixel.com/120/120/sports/8/',
'http://lorempixel.com/120/120/sports/9/'
var americanVintage = ['730E20','831224','152F40','A6986F','D9C7A7'];
var firenze = ['468966','FFF0A5','FFB03B','B64926','8E2800'];