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
drawText(text, options) { | |
const context = this.context; | |
const { baseline, color, font, position, stroke } = options; | |
if (!text.length || text.constructor !== String) { | |
throw new Error( | |
'Text must be a string with at least one character' | |
); | |
} |
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
export default function (element, threshold) { | |
threshold = threshold || 0; | |
var elementTop = element.offsetTop; | |
var elementBottom = elementTop + element.clientHeight; | |
var viewportTop = window.scrollY; | |
var viewportBottom = viewportTop + window.innerHeight; | |
return elementBottom > viewportTop && elementTop < viewportBottom; | |
}, |
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 scrollIntoView($element) { | |
var scrollTop = 0; | |
if ($element.length) { | |
scrollTop = $element.offset().top - | |
$('#headerwrap')[0].clientHeight - 40; | |
window.scrollTo(0, scrollTop); | |
} | |
} |
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
const temp = cityData.list.map(item => item.main.temp); | |
const humidity = cityData.list.map(item => item.main.humidity); | |
const pressure = cityData.list.map(item => item.main.pressure); |
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
const { temp, pressure, humidity } = cityData.list.reduce( | |
(current, item) => { | |
current.temp.push(item.main.temp); | |
current.pressure.push(item.main.pressure); | |
current.humidity.push(item.main.humidity); | |
return current; | |
}, | |
{ temp: [], pressure: [], humidity: [] } | |
); |
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
var animate, camera, clock, composer, elapsedTime, frameCount, init, light, loadModel, maskScene, mesh1, mesh2, mesh3, onWindowResize, outScene, render, renderTarget, renderer, scene, screenHeight, screenWidth, setModel, shader, updateFps; | |
screenWidth = window.innerWidth; | |
screenHeight = window.innerHeight; | |
clock = new THREE.Clock(); | |
elapsedTime = 0; | |
frameCount = 0; | |
init = 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
/*global $*/ | |
class ScrollClass { | |
constructor () { | |
this.$body = $('body'); | |
this.styles = { | |
disabled: { | |
'height': '100%', | |
'overflow': 'hidden', | |
}, |
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
for file in ./* | |
do | |
filename=$(basename "$file") | |
ffmpeg -f gif -i "$file" "${filename%.*}".mp4 | |
mv "${filename%.*}".mp4 ../social_vid | |
done |
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
// How to get SSL Chain certificate in NodeJS | |
/** | |
* You will receive multiple files from the SSL Certificate provider, one is | |
* the certificate, one is the bundle. Node requires this to be in a single | |
* .cert file. | |
* | |
* To do this from the terminal, concatonate the files together. | |
* cat website.com.crt bundle_name.crt > output-bundle.crt | |
*/ |
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 () { | |
'use strict'; | |
var textReplacement = { | |
/** | |
* Converts a string containing Moustache style curly-brace variables, | |
* into a coherent string. | |
* @param {string} string Input string containing | |
* {{ curlyBrace }} variables | |
* @param {object} replacements key / value pair object where the key |