Skip to content

Instantly share code, notes, and snippets.

View grayghostvisuals's full-sized avatar
🐢
I may be slow to respond.

GRAY GHOST grayghostvisuals

🐢
I may be slow to respond.
View GitHub Profile
@grayghostvisuals
grayghostvisuals / scrollmation
Last active July 12, 2016 14:28
Anchor Scroll w/Vanilla JS (also displays hash value)
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; },
#! /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
#
@grayghostvisuals
grayghostvisuals / index.css
Last active August 29, 2015 14:04
SUITCSS Starter File: Remove portions where desired. A listing of every variable is provided along with it's default value.
@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";
@grayghostvisuals
grayghostvisuals / bind-call-args.js
Created June 5, 2014 16:00
Passing Arguments to Event Functions
/**
* @about
* Binding arguments to a function passed through
* an event listener as a named function.
*
* @reference
* http://jsfiddle.net/toddmotto/D3tgu
*/
@grayghostvisuals
grayghostvisuals / classlist-detection.js
Created May 14, 2014 15:17
Detection Method for Classlist Support
if('classList' in document.createElement('p')) {
console.log('classlist supported');
} else {
console.log('classlist not supported');
}
(function() {
var Person = {
init: function() {
this.form = $('#form');
this.bindEvents();
},
bindEvents: function() {
@grayghostvisuals
grayghostvisuals / delay-loop.scss
Created April 16, 2014 18:54
Dustin's Delay Loop
.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; }
@grayghostvisuals
grayghostvisuals / gist:9840994
Created March 28, 2014 19:25
Start Apache Automagically when running vagrant up
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
@grayghostvisuals
grayghostvisuals / grunt-contrib-compass.js
Created January 23, 2014 19:06
Example setup for the grunt-contrib-compass plugin and settings.
// 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',
@grayghostvisuals
grayghostvisuals / fancy-box.js
Created December 3, 2013 14:31
Example of Fancybox API Setup
// ----------------------------------------------------------------------
// =Fancybox
// ----------------------------------------------------------------------
$('.fancybox').fancybox({
// Options
padding : 6,
openEffect : 'elastic', // elastic, fade
closeEffect : 'elastic', // elastic, fade
openSpeed : 325, // default 250