Skip to content

Instantly share code, notes, and snippets.

View motionharvest's full-sized avatar

Aaron motionharvest

View GitHub Profile
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
compass = require('gulp-compass'),
plumber = require('gulp-plumber'),
// autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
@motionharvest
motionharvest / cssonscreen.js
Last active December 23, 2015 20:39
Simple jQuery plugin for giving an element a class when it is scrolled into view
//detect if an object is on the screen or not.
(function($){
var t = 0,
ot,
off,
oh,
selectors = [],
$d = $(document),
$w = $(window),
wh = $w.height(),
@motionharvest
motionharvest / gist:6131326
Created August 1, 2013 13:29
Here is a pure javascript asset loader as a Curl.js module. You create a new instance of it each time you want to load assets. Pass it an object with an "assets", "onComplete", and optionally "onProgress" properties. It does the hard work for you.
define(function() {
function BulkLoader(options) {
new LoadingGroup(options.assets);
//Wrap the image loading so we can identify the asset
function ImageLoader(url, id, callback){
var _id = id;
var _url = url;
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
/** MIT License
*
* KeySpline - use bezier curve for transition easing function
* Copyright (c) 2012 Gaetan Renaudeau <[email protected]>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
<!-- content to be placed inside <body>…</body> -->
<script>
//variable defined inside of the bubble
var observation = "I'm inside a bubble";
</script>
<div id="foo"></div>
<script>
//retrieved from a seperate script tag, but the variable "observation" still exists inside the bubble