Instantly share code, notes, and snippets.

View scrollmation
var scrollmation_parent = document.getElementById(parent_el).nextElementSibling;
var easing = {
linear: function (t) { return t; },
easeInQuad: function (t) { return t*t; },
easeOutQuad: function (t) { return t*(2-t); },
easeInOutQuad: function (t) { return t < 0.5 ? 2*t*t : -1+(4-2*t)*t; },
easeInCubic: function (t) { return t*t*t; },
easeOutCubic: function (t) { return (--t)*t*t+1; },
easeInOutCubic: function (t) { return t < 0.5 ? 4*t*t*t : (t-1)*(2*t-2)*(2*t-2)+1; },
View vhost.py
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
View index.css
@import "suitcss-base";
@import "suitcss-utils-align";
@import "suitcss-utils-display";
@import "suitcss-utils-layout";
@import "suitcss-utils-link";
@import "suitcss-utils-offset";
@import "suitcss-utils-position";
@import "suitcss-utils-size";
@import "suitcss-utils-text";
View bind-call-args.js
/**
* @about
* Binding arguments to a function passed through
* an event listener as a named function.
*
* @reference
* http://jsfiddle.net/toddmotto/D3tgu
*/
View classlist-detection.js
if('classList' in document.createElement('p')) {
console.log('classlist supported');
} else {
console.log('classlist not supported');
}
View IIFE.js
(function() {
var Person = {
init: function() {
this.form = $('#form');
this.bindEvents();
},
bindEvents: function() {
View delay-loop.scss
.q-as > li {
opacity: 0;
$delay: 0ms;
@for $i from 1 through 4 {
$delay: $delay + 40;
&:nth-child(#{$i}) { @include transition-delay($delay); }
}
.visible & { opacity: 1; }
View gist:9840994
sudo vim /etc/init/httpd-start.conf
description "start httpd service after shared folder is mounted"
start on vagrant-mounted
#restart if die
respawn
#creates child processes
expect fork
View grunt-contrib-compass.js
// https://github.com/gruntjs/grunt-contrib-compass
compass: {
dist: {
options: {
httpPath: '/',
httpImagesPath: 'httpPath + "/" + imagesDir',
cssDir: 'app/webroot/css',
sassDir: 'app/webroot/scss',
javascriptsDir: 'app/webroot/js',
imagesDir: 'app/webroot/img',
View fancy-box.js
// ----------------------------------------------------------------------
// =Fancybox
// ----------------------------------------------------------------------
$('.fancybox').fancybox({
// Options
padding : 6,
openEffect : 'elastic', // elastic, fade
closeEffect : 'elastic', // elastic, fade
openSpeed : 325, // default 250