Skip to content

Instantly share code, notes, and snippets.

View countaight's full-sized avatar
🎯
Focusing

Oscar Delgadillo countaight

🎯
Focusing
View GitHub Profile
@countaight
countaight / Header.js
Created March 29, 2019 17:47
React Video Scrolling Header
import React, { Component } from 'react';
import HeaderVideo from './HeaderVideo.mp4';
class Header extends Component {
vid = null;
scrollingDiv = null;
seek = () => {
const frame = window.pageYOffset / 250;
@countaight
countaight / pivotIndex.js
Created February 18, 2019 19:28
Pivot Index Challenge
var reduceAry = function(ary) {
return ary.reduce((a, b) => {
return a + b
}, 0);
}
var pivotIndex = function(nums) {
for (var i=0; i < nums.length; i++) {
if (reduceAry(nums.slice(0, i)) === reduceAry(nums.slice(i+1, nums.length))) {
return i;