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
{ | |
"workbench.colorTheme": "Night Owl (No Italics)", | |
"[typescriptreact]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"eslint.alwaysShowStatus": true, | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | |
"typescript.updateImportsOnFileMove.enabled": "always", | |
"editor.tabSize": 2, | |
"editor.formatOnSave": true, |
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 NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
export YVM_DIR=/usr/local/opt/yvm | |
[ -r $YVM_DIR/yvm.sh ] && . $YVM_DIR/yvm.sh |
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
#test | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/james.maher/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. |
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 floatToString(number) { | |
function getDecimals(number) { | |
if (!isFinite(number)) return 0; | |
let exponent = 1; | |
let p = 0; | |
while (Math.round(number * exponent) / exponent !== number) { | |
exponent *= 10; | |
p++; | |
} | |
return p; |
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
//Below example is to replace `_` in non-vendor `.scss` files. | |
var gulp = require('gulp'); | |
var del = require('del'); | |
var rename = require('gulp-rename'); | |
gulp.task('cloneFilesWithoutChar', function(){ | |
return gulp.src([ | |
'/**/*.scss', //example | |
'!/**/vendor/**' | |
]) |
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
/* | |
scrollByDrag | |
Purpose: | |
Detect how many pixels a user "drags an element" - more specifically, how many pixels a user moves their mouse between mousing down on an element and mousing up. | |
Parameters: | |
Container: | |
parent element containing .drag-element and .drag-content | |
Type: |
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 HomeController = (function(){ | |
var | |
sections, | |
sectionsArray, | |
scrollTicking = false, | |
scrollAnimationClass = "pre_animate", | |
latestKnownScrollY | |
; |
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
// Idea here is to have a background video looping different clips | |
// Each clip has a logo/title element that needs to be positioned separately from the video, | |
// and each logo/title must only show while its clip is on screen. | |
var intro = document.getElementById('_intro'); | |
//begin loading video to be able to listen for 'canplaythrough' event | |
intro.querySelector('video').load(); | |
//canplaythrough chosen to prevent (as much as possible) video buffering |
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
// example HTML: | |
// <img class="background-image" src="images/mobile/everydaycare.jpg"> | |
// Description: Serve mobile image first, and swap directory if page is desktop | |
function setImagesThenPostImageLoad() { | |
var $bgImages = $('.background-image'); | |
var loadCount = 0; | |
$('img.background-image').each(function(){ | |
var str = $(this).attr('src'); |