Skip to content

Instantly share code, notes, and snippets.

View maxrolon's full-sized avatar

Max Rolon maxrolon

View GitHub Profile
var params = {
"method": "GET",
"hostname": "www.<URL>.com",
"port": null,
"headers": {
"cache-control": "no-cache"
}
};
var secret = process.env.SECRETENV;
/*
* Compile an array of dates, between
* a start and end date. Provide the ability
* to skip days of the week.
*/
const saveDay = {
monday:true,
tuesday:true,
wednesday:true,
import scroll from './../lib/scrollListener'
const Velocity = require('velocity-animate')
require('velocity-ui')
const inViewport = el => {
let rect = el.getBoundingClientRect()
return (rect.top < rect.height) && (rect.top + rect.height > 0)
}
var images = []
for (let i = 10; i <= 360;i += 10){
images.push({
getImage: function(){
return new Image().src = `//assets/can_${i}Deg.jpg`
}
@maxrolon
maxrolon / subnav.js
Last active September 16, 2016 17:36
import scroll from '../lib/scrollListener'
const Velocity = require('velocity-animate')
const fetchAnchors = el => {
let anchors = [].slice.call( el.querySelectorAll('[href]') )
return anchors.filter( restrictToHash ).map( fetchDestinations )
}
const restrictToHash = el => /#/.test( el.anchor = el.getAttribute('href') )
@maxrolon
maxrolon / RAFScroll.js
Last active September 16, 2016 16:21
Scroll handlers with RAF
let requestFrame = window.requestAnimationFrame
let cancelFrame = window.cancelAnimationFrame
let scrollChanged, y, prevY = -1, idle = true, queue = [], timeout, tickId, init = false
if (!requestFrame) {
['ms', 'moz', 'webkit', 'o'].every(prefix => {
requestFrame = window[prefix + 'RequestAnimationFrame'];
cancelFrame = window[prefix + 'CancelAnimationFrame'] ||
window[prefix + 'CancelRequestAnimationFrame'];
return !requestFrame;
/*
* A jQuery dependant module that lazy-loads image urls
* Add image urls to a data-src attribute
* If node is not of type 'img' then it's load the src
* as a background-image
*
* The functionality can be overridden on a per-node
* basis by adding the class 'js-kill-load' to the node
*
* Instantiate the module via jQuery plugin syntax
@maxrolon
maxrolon / Contributing.md
Last active August 16, 2016 22:11
Contributing Eg

Contributing

Feel free to post anything you feel may be useful to another team member. In order to add a resource, all you need is the following:

  • A link to a code repository or Github Gist.
  • A .README file (If you're linking to a code repository).
  • Intuitive code comments (block and inline).

README.md Formatting

{
"CustomerEmail": "[email protected]",
"CustomerFirstName": "Max",
"CustomerLastName": "Rolon",
"CustomerPhone": "1234567890",
"GiftCertificateID": 17494997,
"LocationID": 25626,
"PaymentItem": {
"Amount": {
"Amount": 30,