This file contains 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
module.exports = function(grunt){ | |
require("matchdep").filter("grunt-*").forEach(grunt.loadNpmTasks); | |
grunt.initConfig({ | |
wiredep: { | |
target: { | |
src:'index.html' | |
} | |
} |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Untitled</title> | |
<!-- bower:css --> | |
<!-- endbower --> |
This file contains 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
{ | |
"name": "bootstrap", | |
"description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", | |
"version": "3.3.1", | |
"main": [ | |
"less/bootstrap.less", | |
"dist/css/bootstrap.css", | |
"dist/js/bootstrap.js", | |
"dist/fonts/glyphicons-halflings-regular.eot", | |
"dist/fonts/glyphicons-halflings-regular.svg", |
This file contains 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
.element { | |
position: relative; | |
top: 50%; | |
transform: translateY(-50%); | |
} |
This file contains 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
table { display: table } | |
tr { display: table-row } | |
thead { display: table-header-group } | |
tbody { display: table-row-group } | |
tfoot { display: table-footer-group } | |
col { display: table-column } | |
colgroup { display: table-column-group } | |
td, th { display: table-cell } | |
caption { display: table-caption } |
This file contains 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 arr = [2,3,4,5,2,4]; | |
//Without Set | |
var tempArr = arr.filter(function(item,index){ | |
return arr.indexOf(item) == index; | |
}); | |
console.log(tempArr.length); //4 | |
This file contains 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 alphabet = ["a","d","e","h","i"], | |
firstSet = ["b","c"], | |
secondSet = ["f","g"]; | |
//Without Spread operator | |
Array.prototype.splice.apply(alphabet,[1,0].concat(firstSet)); //[a,b,c,d,e,h,i] | |
Array.prototype.splice.apply(alphabet,[4,0].concat(secondSet)); //[a,b,c,d,e,f,g,h,i] | |
console.log("Without Spread Operator: ",alphabet); //[a,b,c,d,e,f,g,h,i] |
This file contains 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 register = function(name,age,gender){ | |
console.log([name,age,gender].join(" ")); | |
} | |
var arr = ["Mary","22","F"]; | |
//Without Spread Operator | |
register.apply(null,arr); // "Mary 22 F" | |
//With Spread Operator |
This file contains 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
//Without Rest Parameters | |
function rollCall(){ | |
var names = Array.prototype.slice.call(arguments); | |
names.forEach(function(name){ | |
console.log(name); | |
}); | |
} | |
//With Rest Parameters |
This file contains 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
//Without Default Parameters | |
function sell(seller, price){ | |
price = price || 2; | |
seller = seller || "John"; | |
console.log(seller + " is selling at $"+price); | |
} | |
//With Default Parameters | |
function sellWithDefault(seller = "John", price = 2){ |