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
<div class="twitter-logo"> | |
<span class="head">Welcome to Twitter.</span> | |
<span class="beak-top">Find out what’s happening,</span> | |
<span class="beak-bottom">right now,</span> | |
<span class="wing-top">with the people</span> | |
<span class="wing-middle">and organizations</span> | |
<span class="wing-bottom">you care about.</span> | |
<span class="body">Logo remade by <a href="//jonweb.co.uk">Jonathan Cousins (@evolutionxbox)</a></span> | |
</div> | |
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 (!String.prototype.reverse) { | |
String.prototype.reverse = function reverse() { | |
if (typeof this !== 'string') { | |
this.split('').reverse().join(''); | |
} else { | |
throw new ReferenceError(this); | |
} | |
} | |
} |
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
// Returns array of objects containing the character it found, and it's hexidecimal string value. | |
function findUnicodeChars(str) { | |
var arr = str.split(''); | |
return arr.filter(char => { | |
return (char.charCodeAt(0) > 255) && char; | |
}).map(char => { | |
return { | |
char: char, | |
code: char.charCodeAt(0).toString(16) | |
}; |
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
GEM | |
remote: https://rubygems.org/ | |
specs: | |
colorator (1.1.0) | |
ffi (1.9.14) | |
foreman (0.78.0) | |
thor (~> 0.19.1) | |
forwardable-extended (2.6.0) | |
jekyll (3.2.1) | |
colorator (~> 1.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
// Get URL params (querystring) | |
if (!location.params) { | |
Object.defineProperty(location, 'params', { | |
enumerable: false, | |
get: function () { | |
var search = location.search; | |
var all = /(?:[?&;])(?:[^&;#]+)/g; | |
var pair = /[?&;]([^&;=#]+)=?([^&;#]*)/; | |
var results = {}; |
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 dateObj(d) { | |
var parts = d.split(/:|\s/), | |
date = new Date(); | |
if (parts.pop().toLowerCase() == 'pm') parts[0] = (+parts[0]) + 12; | |
date.setHours(+parts.shift()); | |
date.setMinutes(+parts.shift()); | |
return date; | |
} |
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
// Wrap all "rogue" textNodes in a paragraph | |
(function wrapAllRogueTextNodes () { | |
var allowedElements = [ 'A', 'B', 'BIG', 'I', 'SMALL', 'TT', 'ABBR', 'ACRONYM', 'CITE', 'DFN', 'EM', 'KBD', 'STRONG', 'TIME', 'BR', 'SUB', 'SUP' ]; | |
function arrayFrom (arrayLike) { | |
return Array.prototype.slice.call(arrayLike); | |
} | |
function wrapInParagraph (nodes) { | |
if (nodes.length > 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
// TODO: convert into promise =) | |
// Load Script | |
function loadScript(url, callback) { | |
if (!url || url === '') return; | |
var scriptElement = document.createElement('script'); | |
scriptElement.src = url; | |
if(typeof callback === 'function') { |
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
// TODO: convert into promise =) | |
// Load Style | |
function loadStyle(url, callback) { | |
if (!url || url === '') return; | |
var linkElement = document.createElement('link'); | |
linkElement.href = url; | |
linkElement.setAttribute('rel', 'stylesheet'); |
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
/* | |
# `Array.prototype.reject` | |
## Summary | |
Like `filter`, except negated. | |
**Example:** | |
```js |