git archive -o update.zip HEAD $(git diff --name-only <starting SHA> HEAD)
or
if (!("ontouchstart" in document.documentElement)) { | |
document.documentElement.className += " no-touch"; | |
} |
// https://bolt.cm/ | |
// MAKE TOPIMAGE SCROLL SLOWER FOR PARALLAX EFFECT | |
$(window).scroll(function () { | |
$('header').css('backgroundPosition', '0px ' + (posTop() / 2) + 'px'); | |
}); | |
// FIX FOR SCROLLPOS IN ALL BROWSERS | |
function posTop() { | |
return typeof window.pageYOffset != 'undefined' ? window.pageYOffset: document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop? document.body.scrollTop:0; |
'use strict'; | |
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var browserSync = require('browser-sync').create(); | |
var rigger = require('gulp-rigger'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
// variant 1: without `return` |
// Usage: | |
// $ npm install gulp browser-sync --save-dev | |
// $ gulp serve | |
'use strict'; | |
var gulp = require('gulp'); | |
var browserSync = require('browser-sync').create(); | |
gulp.task('serve', function() { |
Use the following command to optimise a JPG and make it progressive:
$ convert -strip -interlace Plane -quality 80 input-file.jpg output-file.jpg
Batch all the images in a folder like this:
$ for i in source/images/backgrounds/*.jpg; do convert -strip -interlace Plane -quality 80 $i $i; done
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style> | |
.path { |
There are also online tools which can help you optimize your pictures with loss of quality, by performing safe automatic tasks:
If you are at ease with command line tools, you can use these: