This file contains hidden or 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
//--------------Variables------------- | |
- | |
first= "", | |
last= "", | |
profFirst= "", | |
profLast= "", | |
program= "PhD, Environmental Toxicology", | |
eduList= [ | |
"" | |
], |
This file contains hidden or 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
// factory | |
const http = () => { | |
const | |
XHR = () => { | |
return new XMLHttpRequest() | |
}, | |
onload = (req, fn, parse = true) => { | |
req.onload = () => { | |
if (req.status >= 200 && req.status < 400) { | |
let data = req.responseText |
This file contains hidden or 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
// Page Transition | |
(function () { | |
"use strict"; | |
var | |
doc = document, | |
$content = doc.querySelector('#content'), | |
$main = doc.querySelector('#main'), | |
$footer = doc.querySelector('.prefooter'), | |
$links = doc.querySelectorAll('#content a[href^="/"]'), |
This file contains hidden or 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() { | |
// VARIABLES | |
const | |
// dom terms | |
dom = document, | |
query = 'querySelector', | |
parent = 'parentNode', | |
next = 'nextElementSibling', | |
attr = 'getAttribute', |
This file contains hidden or 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() { | |
// example: <li data-expire="April 17, 2017"></li> | |
var $elems = document.querySelectorAll('[data-expire]'), | |
today = new Date(); | |
for( | |
var el = 0, | |
len = $elems.length, | |
expire = null; | |
el < len; |
This file contains hidden or 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
<style> | |
@import url("http://npmcdn.com/flickity@2/dist/flickity.css"); | |
.carousel * { | |
box-sizing: border-box; | |
} | |
.carousel img { | |
height: auto; | |
} | |
.carousel { | |
background: #FAFAFA; |
This file contains hidden or 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
// filterBy(deepArrayOfAnything, "friend", {limitTo: 2, sortBy: "name", ignoreKey: "keywords"}) | |
(function (win, doc, undefined) { | |
const isTypeArray = (obj) => Array.isArray(obj), | |
isTypeObject = (obj) => (typeof obj === 'object'), | |
isObjectOrArray = (obj) => (isTypeObject(obj) || isTypeArray(obj)), | |
isObjectAndNotArray = (obj) => (isTypeObject(obj) && !isTypeArray(obj)), | |
isNumeric = (num) => !isNaN(num), | |
isNumberBooleanOrString = (obj) => ( | |
typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean'), |
This file contains hidden or 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
// by Abraham Juliot, December 2016 | |
/* SELECTORS | |
* myElement = dom('top', 'id') or dom('#red', 'id') uses getElementById, returns an Element object | |
* myElement = dom('.note a', 'first') uses querySelector, returns an Element object | |
* myElements = dom('red', 'class') or dom('.red', 'class') uses getElementsByClassName, returns a HTMLCollection object | |
* myElements = dom('span', 'tag') uses getElementsByTagName, returns a HTMLCollection object | |
* myElements = dom('article img') uses querySelectorAll, returns a NodeList object | |
* | |
* RETURN METHODS |
This file contains hidden or 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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
NewerOlder