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
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); | |
// Or more strong | |
function guid() { | |
function s4() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
s4() + '-' + s4() + s4() + s4(); |
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 gulp = require('gulp'); | |
var rename = require("gulp-rename"); | |
var translit = require('speakingurl'); | |
gulp.task('translit', function () { | |
gulp.src("./*.*") | |
.pipe(rename(function(path){ | |
var trl = translit(path.basename, { | |
lang: 'en' | |
}) |
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 textAreaResize() { | |
var textArea = document.getElementById('text'); | |
textArea.addEventListener('input', resize); | |
function resize() { | |
textArea.style.height = 'auto'; | |
textArea.style.height = text.scrollHeight + 2 + 'px'; | |
} | |
} | |
textAreaResize(); |