Skip to content

Instantly share code, notes, and snippets.

@vinacms
Last active March 25, 2017 20:13
Show Gist options
  • Save vinacms/27e28999f261db47d6d787ef31846216 to your computer and use it in GitHub Desktop.
Save vinacms/27e28999f261db47d6d787ef31846216 to your computer and use it in GitHub Desktop.
find -name '*.jpg' -print0 | xargs -0 --no-run-if-empty -I{} -P4 guetzli --quality 85 --verbose {} {}
apt-get install libpng-dev
apt-get install pkg-config
wget https://github.com/google/guetzli/releases/download/v1.0.1/guetzli_linux_x86-64 guetzli
chmod +x guetzli
find -name '*.jpg' -print0 | xargs -0 --no-run-if-empty -I{} -P4 ./var/www/html/guetzli --quality 85 --verbose {} {}
#####pngquant--install####
git clone --recursive https://github.com/pornel/pngquant.git
make
make install
find /var/www/html/kenhtinnhadat/frontend/web/themes/xigrandcourt/img -name '*.png' -exec pngquant -ext .png -force 256 {} \;
###webp###
apt install webp
apt install parallel
find . -name "*.png" | parallel -eta cwebp {} -o {.}.webp
@vinacms
Copy link
Author

vinacms commented Mar 24, 2017

var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify');
var cleanCSS = require('gulp-clean-css');

var configs = {
'coreJS': [
'js/jquery.min.js',
'js/bootstrap.js',
'js/owl.carousel.min.js',
'js/smoothscroll.js',
'js/wow.min.js',
'js/yii.js',
'js/functions.js',
],
'coreCSS': [
'css/bootstrap.css',
'css/font-awesome.min.css',
'css/owl.carousel.css',
'css/owl.theme.default.css',
'css/owl.theme.green.css',
'css/animate.min.css',
'css/style.css',
]};
var jsDest = 'dist/js';

gulp.task('scripts', function() {
return gulp.src(configs.coreJS)
.pipe(concat('scripts.js'))
.pipe(minify())
.pipe(gulp.dest(jsDest));
});

gulp.task('minify-css', function() {
return gulp.src(configs.coreCSS)
.pipe(concat('styles.css'))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('dist'));
});

gulp.task('default', ['scripts', 'minify-css']);

@vinacms
Copy link
Author

vinacms commented Mar 24, 2017

{
"name": "xigrand",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"gulp-clean-css": "^3.0.4",
"gulp-concat": "^2.6.1",
"gulp-minify": "0.0.15",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^2.1.2"
},
"dependencies": {
"gulp": "^3.9.1"
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment