Skip to content

Instantly share code, notes, and snippets.

View brunogarcia's full-sized avatar
📚
Always learning

Bruno brunogarcia

📚
Always learning
View GitHub Profile
@brunogarcia
brunogarcia / backbone_testing.html
Last active December 15, 2015 12:48
A simple Backbone testing: model, collection, views, templates and router. Example based in Tuts+ Course: http://kcy.me/hml7
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A simple Backbone testing</title>
</head>
<body>
<script id="userTemplate" type="text/template">
<li><%= id %></li>
/*
Bower copy
Scrupulously manage file locations for bower dependencies.
https://www.npmjs.com/package/grunt-bowercopy
*/
'bowercopy': {
libs: {
options: {
destPrefix: '<%= config.dev %>/assets/js/vendors'
},
/*
FTP Deploy
Grunt task for code deployment over ftp
https://github.com/zonak/grunt-ftp-deploy
*/
'ftp-deploy': {
build: {
auth: {
host: 'ftp.TU_DOMINIO.com',
port: 21,
/*
Cache breaker
Simple cache-breaker, appends a timestamp or md5 hash to any urls
https://www.npmjs.com/package/grunt-cache-breaker
*/
'cachebreaker': {
dev: {
options: {
match: ['main.min.js', 'main.css'],
},
/*
Sass
Compile Sass to CSS
https://www.npmjs.com/package/grunt-contrib-sass
*/
'sass': {
dist: {
options: {
style: 'compressed'
},
/*
Sass
Compile Sass to CSS
https://www.npmjs.com/package/grunt-contrib-sass
*/
'sass': {
dev: {
options: {
style: 'expanded'
},
/*
HTML Min
Minify HTML
https://github.com/gruntjs/grunt-contrib-htmlmin
*/
'htmlmin': {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
/*
Process HTML
Process html files at build time to modify them depending on the release environment
https://www.npmjs.com/package/grunt-processhtml
*/
'processhtml': {
dist: {
files: {
'<%= config.tmp %>/index.html': ['<%= config.dev %>/index.html']
}
/*
Uglify
Minify files with UglifyJS
https://github.com/gruntjs/grunt-contrib-uglify
*/
'uglify': {
my_target: {
files: {
'<%= config.dist %>/assets/js/main.min.js':
[
/*
Copy
Copy files and folders.
https://github.com/gruntjs/grunt-contrib-copy
*/
'copy': {
main: {
files: [
{
'expand': true,