Skip to content

Instantly share code, notes, and snippets.

Avatar

James Holland jholl

View GitHub Profile
View Test object top above window top
$(document).on('scroll',function(){
var winTop = $(window).scrollTop();
var $object = $('.some-div');
$object.each(function(){
var objTopTrigger = this.offsetTop;
var objTopTriggerAdj = 400;
if (objTopTrigger + objTopTriggerAdj < winTop){
$(this).addClass('some-class');
}
if (objTopTrigger + objTopTriggerAdj > winTop){
@jholl
jholl / level-like
Created Jan 2, 2014
level like objects
View level-like
<script type="text/javascript">
$(document).ready(function(){
H = 0;
$('.foo').each(function(){
if ($(this).innerHeight() > H){
H = $(this).innerHeight();
}
});
$('.foo').height(H);
});
@jholl
jholl / variables-custom.less
Created Nov 29, 2013
BS v3 variables-custom.less -- add @import "rootfoo/variables-custom.less" to compiling .less file
View variables-custom.less
/* Flat UI @design-modo */
@fui-turq-lt: #1abc9c;
@fui-turq: #16a085;
@fui-green-lt: #2ecc71;
@fui-green: #27ae60;
@fui-blue-lt: #3498db;
@fui-blue: #2980b9;
@fui-purple-lt: #9b59b6;
@fui-purple: #8e44ad;
@fui-navy-lt: #34495e;
View gist:02c39a3ac441589e4c07
$(document).ready(function(){
// Create two variables:
// 1) Create a '<span></span>' element that we'll eventually put into the DOM
// 2) Cache the container already in the DOM where we'll put the span
var itemCountSpan = document.createElement("SPAN"),
cart = document.getElementById('cart-icon-wrapper');
// Set the initial text and class for the span before we put into the DOM
@jholl
jholl / DatabaseSeeder.php
Created Mar 27, 2015
DatabaseSeeder to extend table cleanups/seeding ea. run (Laravel 5)
View DatabaseSeeder.php
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Filesystem\Filesystem;
class DatabaseSeeder extends Seeder {
/**
* Seeders to run.
@jholl
jholl / gist:34e419a42040f24f7562
Created Mar 27, 2015
gulpfile for laravel angular bower build
View gist:34e419a42040f24f7562
var elixir = require('laravel-elixir');
var paths = {
'bower': './vendor/bower_components/'
};
var paths = {
'fonts': 'resources/assets/fonts/',
'img': 'resources/assets/img/',
'svg': 'resources/assets/svg',
'sass': 'resources/assets/sass/',
'js': 'resources/assets/js/',
@jholl
jholl / sba_counties.json
Created Mar 23, 2015
SBA Data US County by US State
View sba_counties.json
[
{
"county_name": null,
"description": null,
"feat_class": "Civil",
"feature_id": "36609",
"fips_class": "H1",
"fips_county_cd": "69",
"full_county_name": null,
"link_title": null,