Skip to content

Instantly share code, notes, and snippets.

View motionharvest's full-sized avatar

Aaron motionharvest

View GitHub Profile
<!-- 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
/*! @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 <renaudeau.gaetan@gmail.com>
*
* 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,
@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;
@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(),
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'),
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 / gulpfile.js
Created February 6, 2014 16:28
gulpfile.js
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'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
cache = require('gulp-cache'),
livereload = require('gulp-livereload'),
@motionharvest
motionharvest / package.json
Created February 6, 2014 16:30
Packages for dev dependencies
{
"devDependencies": {
"gulp-livereload": "~0.3.2",
"gulp-concat": "~2.1.7",
"tiny-lr": "0.0.5",
"gulp-minify-css": "~0.3.0",
"gulp": "~3.5.1",
"gulp-ruby-sass": "~0.3.0",
"gulp-uglify": "~0.2.0",
"gulp-cache": "~0.1.1",
@motionharvest
motionharvest / gist:8966180
Created February 12, 2014 22:50
Internal Access to Node
/*
Give internal access via buffer
*/
var stdin = process.openStdin();
stdin.setEncoding( 'utf8' );
var abilities = {
reload: function (){
gulp.run('reload');
}
}
@motionharvest
motionharvest / index.js
Created August 5, 2014 20:26
Local changes to gulp-ruby-sass
'use strict';
var fs = require('fs');
var path = require('path');
var chalk = require('chalk');
var dargs = require('dargs');
var slash = require('slash');
var gutil = require('gulp-util');
var spawn = require('win-spawn');
var eachAsync = require('each-async');
var glob = require('glob');