This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## First you have to enable mod_expires ( sudo a2enmod expires ) | |
## EXPIRES CACHING ## | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresByType image/jpg "access 1 year" | |
ExpiresByType image/jpeg "access 1 year" | |
ExpiresByType image/gif "access 1 year" | |
ExpiresByType image/png "access 1 year" | |
ExpiresByType text/css "access 1 month" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a VagrantFile | |
vagrant init ubuntu/trusty64 | |
// Download the Box specified in the Vagrant File and setup the box | |
vagrant up | |
// ssh into the vagrant box | |
vagrant ssh | |
// tell about the running vagrant boxes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checking network configuration | |
ifconfig | |
# Print working directory. The “working directory” is the directory you are current in | |
pwd | |
# List contents of current working directory | |
ls | |
# List contents in a list form, with extra information: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
• curl - Making HTTP requests | |
• wget - Retrieve files from the web | |
• unzip - Unzip zip files | |
• git - Git version control | |
• ack - An advanced search tool for searching content of files | |
• htop - Interactive process viewer (better than the simple “top”) | |
• vim - The timeless editor. Pro-Tip: Hit “esc” then type “:q” then hit “Enter” to quit. Now you | |
know. | |
• tmux - Terminal Multiplexor - Basically, split your terminal session into different panes | |
• software-properties-common - This is specific to Ubuntu. We’ll use it to add software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path'); | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require("extract-text-webpack-plugin"); | |
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
var ManifestPlugin = require('webpack-manifest-plugin'); | |
var env = process.env.NODE_ENV ? process.env.NODE_ENV : 'dev'; | |
// outfile name based on enviroment | |
var outfile_name = env == "dev" ? "[name]" : "[name]-[hash]"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.some-button').click(function(){ | |
console.log('clicked a button'); | |
}); | |
$('.another-button').click(function(){ | |
console.log('clicked another button'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myNamespace = (function () { | |
var myPrivateVar, myPrivateMethod; | |
// A private counter variable | |
myPrivateVar = 0; | |
// A private function which logs any arguments | |
myPrivateMethod = function( foo ) { | |
console.log( foo ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var users = (function(){ | |
var actions = { | |
}; | |
var form = { | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# init.js | |
require('./users').init(); | |
require('./categories').init(); | |
require('./posts').init(); | |
require('./comments').init(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var users = (function(){ | |
var actions = { | |
onClickSomeButton: function(e){ | |
console.log('button clicked'); | |
}, | |
onKeyupSomeInput: function(e){ | |
console.log('key is pressed'); | |
} | |
}; |
OlderNewer