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
function initLogger () { | |
for(var eventName in $.event.global) { | |
$("*").bind(eventName, function(event) { | |
console.log( | |
event.type+": "+ | |
event.target.nodeName+") "+ | |
Array.prototype.slice.call(arguments, 1).join(", ")); | |
}); | |
} | |
} |
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
@mixin clearfix() { | |
& { | |
*zoom: 1; | |
} | |
&:before, | |
&:after { | |
content: ""; | |
display: table; | |
} | |
&:after { |
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
@mixin center-block { | |
display: block; | |
margin-left: auto; | |
margin-right: auto; | |
} |
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
Show hidden characters
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |
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
{ | |
/* | |
Sets the mode in which SublimeLinter runs: | |
true - Linting occurs in the background as you type (the default). | |
false - Linting only occurs when you initiate it. | |
"load-save" - Linting occurs only when a file is loaded and saved. | |
*/ | |
"sublimelinter": true, |
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
const arr = [1, 2, 3, 4, 5]; | |
const last = [...arr].pop(); | |
// or | |
const [last2, ...rest] = arr.reverse(); |
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
const rotateMatrix = arr => arr[0].map((col, i) => arr.map(row => row[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
// create a new array of N elements filled with specific value | |
const isBusy = true; | |
const n = 12; | |
const schedule = [...Array(n).fill(isBusy)]; |
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
const unique = arr => arr.filter( | |
(el, index, self) => index === self.indexOf(el) | |
); |
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
{ | |
"rules": { | |
"align": [ | |
true, | |
"parameters", | |
"arguments", | |
"statements" | |
], | |
"ban": false, | |
"class-name": true, |