Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
I may be slow to respond.

GRAY GHOST grayghostvisuals

🐢
I may be slow to respond.
View GitHub Profile
@grayghostvisuals
grayghostvisuals / scrollmation
Last active Jul 12, 2016
Anchor Scroll w/Vanilla JS (also displays hash value)
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
#
@grayghostvisuals
grayghostvisuals / index.css
Last active Aug 29, 2015
SUITCSS Starter File: Remove portions where desired. A listing of every variable is provided along with it's default value.
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";
@grayghostvisuals
grayghostvisuals / bind-call-args.js
Created Jun 5, 2014
Passing Arguments to Event Functions
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
*/
@grayghostvisuals
grayghostvisuals / classlist-detection.js
Created May 14, 2014
Detection Method for Classlist Support
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; }
@grayghostvisuals
grayghostvisuals / gist:9840994
Created Mar 28, 2014
Start Apache Automagically when running vagrant up
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
@grayghostvisuals
grayghostvisuals / grunt-contrib-compass.js
Created Jan 23, 2014
Example setup for the grunt-contrib-compass plugin and settings.
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',
@grayghostvisuals
grayghostvisuals / fancy-box.js
Created Dec 3, 2013
Example of Fancybox API Setup
View fancy-box.js
// ----------------------------------------------------------------------
// =Fancybox
// ----------------------------------------------------------------------
$('.fancybox').fancybox({
// Options
padding : 6,
openEffect : 'elastic', // elastic, fade
closeEffect : 'elastic', // elastic, fade
openSpeed : 325, // default 250