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 / validator.addMethod.passMatch.js
Created October 15, 2013 00:12
A simplistic way to make sure two password fields match using jQueryValidation (http://jqueryvalidation.org/validate) Using minlength, and a custom message.
jQuery.validator.addMethod( 'passwordMatch', function(value, element) {
// The two password inputs
var password = $("#register-password").val();
var confirmPassword = $("#register-pass-confirm").val();
// Check for equality with the password inputs
if (password != confirmPassword ) {
return false;
} else {
@grayghostvisuals
grayghostvisuals / disable-scroll.js
Created November 27, 2013 01:40
Disable hover on scroll to improve performance and avoid costly paints.
// Disable Hover on Scroll Class
// Add these helpers to your utlity.css
// http://www.thecssninja.com/javascript/pointer-events-60fps
.disable-hover,
.disable-hover * {
pointer-events: none !important;
}
// ----------------------------------------------------------------------
@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
@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 / 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 / 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; }
(function() {
var Person = {
init: function() {
this.form = $('#form');
this.bindEvents();
},
bindEvents: function() {
@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');
}
@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 / 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";