Skip to content

Instantly share code, notes, and snippets.

Avatar

James Kusachi jkusachi

View GitHub Profile
View DWGL-5162
/* Added to Auto News Flyout */
.producthits .section{ padding-bottom: 20px; }
View gulpfile-starter.js
var gulp = require('gulp'),
sass = require('gulp-sass'),
livereload = require('gulp-livereload'),
gutil = require('gulp-util'),
plumber = require('gulp-plumber'),
uglify = require('gulp-uglify');
var sources = {
styles: ['./sass/**/**/*.scss'],
scripts: ['./js/**/**/*.js']
@jkusachi
jkusachi / fade-in-fade-out.js
Last active Aug 29, 2015
Javascript Image Fade In / Fade Out
View fade-in-fade-out.js
(function($){
'use strict';
function scrolled(){
var scrollTop = $(window).scrollTop(),
windowBottom = scrollTop + $(window).height(),
images_in_view = $('img:in-viewport');
//for each image in view, fade out on bottom
View tag-c.js
javascript:(function()%7Bif(typeof __tealium_tagcompanion%3D%3D%27undefined%27)%7B__tealium_tagcompanion%3Ddocument.createElement(%27SCRIPT%27)%3B__tealium_tagcompanion.type%3D%27text/javascript%27%3B__tealium_tagcompanion.src%3D%27//tealium.hs.llnwd.net/o43/utui/utui.tagcompanion.js%3Fv%3D%27%2BMath.random()%3Bdocument.getElementsByTagName(%27head%27)%5B0%5D.appendChild(__tealium_tagcompanion)%3B%7D%7D)()%3B
View phantomjs_intaller.sh
#!/bin/bash
sudo apt-get remove phantomjs
sudo unlink /usr/local/bin/phantomjs
sudo unlink /usr/local/share/phantomjs
sudo unlink /usr/bin/phantomjs
cd /usr/local/share
View bootstrap.js
/*!
* Casper is a navigation utility for PhantomJS.
*
* Documentation: http://casperjs.org/
* Repository: http://github.com/n1k0/casperjs
*
* Copyright (c) 2011-2012 Nicolas Perriault
*
* Part of source code is Copyright Joyent, Inc. and other Node contributors.
*
View validator.js
'use strict';
var filter = require('lodash/collection/filter');
var typeRegexes = {
/*eslint-disable */
email: /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i
@jkusachi
jkusachi / dedupe-not-null-by-key.js
Created Feb 11, 2016
Takes a collection of data and removes any duplicates, based on key, thare are not null. If the key value is null, it is not filtered out.
View dedupe-not-null-by-key.js
var deDupeNonNull = function(data, key){
var used = [];
return _.reduce(data, function(cur, data){
if(!!data[key] && !_.includes(used, data[key])){
used.push(data[key]);
cur.push(data);
}
else if(!data[key]) {
cur.push(data);
@jkusachi
jkusachi / destructuring.js
Created Mar 31, 2016
Playing with Destructuring
View destructuring.js
var master = {
data: {
values: [1, 2, 3],
labels: ["one", "two", "three"],
food: {
name: "pizza"
},
groups: [
{
brand: 'zillow',
View passing-of-the-args.js
var data = {
name: 'james',
age: 30
};
function doSomething(){
console.log('- doSomething');
return (...args) => {
You can’t perform that action at this time.