Skip to content

Instantly share code, notes, and snippets.

View willdavidow's full-sized avatar

Will Davidow willdavidow

View GitHub Profile
@willdavidow
willdavidow / accordion.js
Created December 11, 2019 02:24
Simple Accordion (built using Hammer JS and TweenLite)
/*
* Accordion functionality
*/
const accordion = (() => {
const COLLAPSED = '0';
const EXPANDED = '1';
let curItem;
let prevItem;
let items;
@willdavidow
willdavidow / csv-to-json.js
Created April 23, 2019 00:51 — forked from jssuttles/csv-to-json.js
CSV to JSON Conversion in JavaScript
//var csv is the CSV contents with headers
function csvJSON(csv){
var lines=csv.split('\n');
var result = [];
var headers=lines[0].split(',');
lines.splice(0, 1);
lines.forEach(function(line) {
@willdavidow
willdavidow / in_viewport.js
Created September 28, 2017 14:16 — forked from jjmu15/in_viewport.js
check if element is in viewport - vanilla JS. Use by adding a “scroll” event listener to the window and then calling isInViewport().
// Determine if an element is in the visible viewport
function isInViewport(element) {
var rect = element.getBoundingClientRect();
var html = document.documentElement;
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || html.clientHeight) &&
rect.right <= (window.innerWidth || html.clientWidth)
);
// Array merge function. Credit: Kyle Simpson - https://github.com/getify. Link: https://davidwalsh.name/combining-js-arrays
export const arrayMerge = (head, tail) => {
return tail.reduce( (coll, item) => {
coll.push(item);
return coll;
}, head);
};
@willdavidow
willdavidow / keybase.md
Created March 22, 2017 14:45
Keybase Verification

Keybase proof

I hereby claim:

  • I am willdavidow on github.
  • I am wdavidow (https://keybase.io/wdavidow) on keybase.
  • I have a public key ASAdyfwVUQenTzRYvEjSmoJC0d7mCelW78Kdi0_hpOD73Ao

To claim this, I am signing this object:

@willdavidow
willdavidow / smacss.txt
Created January 12, 2016 02:45 — forked from chipcullen/smacss.txt
SMACSS Property Order for SCSS Lint
# SMACSS Property Order
# http://smacss.com/book/formatting
# Box
display
position
top
right
bottom
@willdavidow
willdavidow / .vimrc
Last active December 11, 2019 03:03
Current .vimrc
"===============================================================================================================
" Will Davidow: (N)VIM(R) Configuration.
"===============================================================================================================
set nocompatible " disable vi compaibility mode
filetype off " required
" default settings
"===============================================================================================================