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
/** | |
* Check element has a certain classname | |
* We cannot use classList yet because of browser support | |
* @param {Object} ele DOM element | |
* @param {String} cls Classname | |
* @return {Boolean} True is classname is found | |
*/ | |
function hasClass(ele,cls) { | |
if (ele === null || cls === '') return false; | |
return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)')); |
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
#!/bin/sh | |
# | |
npm version patch | |
git add package.json | |
exit 0 |
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
grunt.registerTask('default', function () { | |
var fs = require('fs'); | |
// my precommit hook is inside the repo as /hooks/pre-commit | |
// copy the hook file to the correct place in the .git directory | |
grunt.file.copy('hooks/pre-commit', '.git/hooks/pre-commit'); | |
// chmod the file to readable and executable by all | |
fs.chmodSync('.git/hooks/pre-commit', '755'); | |
}); |
NewerOlder