Skip to content

Instantly share code, notes, and snippets.

@heyjohnmurray
heyjohnmurray / my gulp sourcemap implementation
Created October 20, 2015 16:02
gulp sourcemap implementation
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
gulp.task('sass', function() {
return gulp.src(paths.styles.src + 'partials/*.scss')
.pipe(sourcemaps.init()) // all your piping needs to fit between the sourcemaps.init() and sourcemaps.write()
.pipe(concat('main.css'))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
@heyjohnmurray
heyjohnmurray / document.ready function
Created October 8, 2015 15:59
vanilla js version of $(document).ready();
var readyFunction = function () {
// begin to put your code here
}
if (document.readyState != 'loading') {
readyFunction();
}
else {
document.addEventListener('DOMContentLoaded', readyFunction)
}