Skip to content

Instantly share code, notes, and snippets.

1. Edit Vagrant file
-----------------------------------------
# Vagrantfile #65
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :machine
config.cache.synced_folder_opts = {
type: :nfs,
mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
}
@laurentlemaire
laurentlemaire / gulpfile.js
Last active May 17, 2016 17:10
Gulp setup - 2
var gulp = require('gulp');
var imageResize = require('gulp-image-resize');
var rename = require('gulp-rename');
gulp.task('img-thumb', function () {
return gulp.src('web/galleries/uploads/*/*.jpg')
.pipe(imageResize({
width : 365,
height : 300,
crop : true,
@laurentlemaire
laurentlemaire / browserify.js
Last active November 16, 2015 00:53
Gulp setup - 1
var gulp = require('gulp');
var path = require('path');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var gulpif = require('gulp-if');
var uglify = require('gulp-uglify');
var streamify = require('gulp-streamify');
var notify = require('gulp-notify');
@laurentlemaire
laurentlemaire / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@laurentlemaire
laurentlemaire / gist:7d970cedeacd1c9dbd94
Created October 3, 2014 11:45
Shell mysql backup script
#!/bin/sh
# Parameters
. export_db-params
echo Script start
# File cleaning
find ${export_path}/* -type f -mtime +15 -delete;
# Mysql dump
@laurentlemaire
laurentlemaire / gist:8c137e703accadcd3988
Created September 18, 2014 22:04
getcatt.com .htaccess - Laurent Lemaire
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteEngine On
@laurentlemaire
laurentlemaire / gist:74544b0697dfcceadf2f
Created September 18, 2014 22:01
getcatt.com Grunt.js - Laurent Lemaire
var jpegtran = require('imagemin-jpegtran');
var mozjpeg = require('imagemin-mozjpeg');
module.exports = function(grunt) {
// Project configuraiton
grunt.initConfig({
compass: {
dist: {
options: {
config: 'config.rb'
@laurentlemaire
laurentlemaire / watchandsync
Created June 30, 2014 07:01
Vagrant rsync watcher (Mac osx)
#!/bin/sh
##
# Keep local path in sync with remote path on server.
# Ignore .git metadata.
#
local=$BASEDIR
project='projetctname'
remote='root@vagrantbox.com:/var/www/'$project
# Initialization - copy entire directory to host