Skip to content

Instantly share code, notes, and snippets.

@dtudury
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dtudury/9501081 to your computer and use it in GitHub Desktop.
Save dtudury/9501081 to your computer and use it in GitHub Desktop.
/*
javascript:(function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', 'https://rawgit.com/dtudury/9501081/raw/881aa3218effc7c8d108b5537fe18e427b246e98/page1.js');
document.body.appendChild(jsCode);
}());
*/
var numbers = "0123456789";
function randomNumber() {
return numbers.charAt(Math.floor(Math.random() * numbers.length));
}
var vowels = "aeiou";
function randomVowel() {
return vowels.charAt(Math.floor(Math.random() * vowels.length));
}
var consonants = "bcdfghjklmnpqrstvwxyz";
function randomConsonant() {
return consonants.charAt(Math.floor(Math.random() * consonants.length));
}
function randomPhone(min, max) {
var b = Math.floor((max - min) * Math.random()) + min;
var phone = "";
for (var i = 0; i < b; i++) {
phone += randomNumber();
}
return phone;
}
function randomName(min, max) {
var a = Math.floor(2 * Math.random());
var b = Math.floor((max - min) * Math.random()) + min + a;
var name = "";
for (var i = a; i < b; i++) {
if(i % 2) {
name += randomVowel();
} else {
name += randomConsonant();
}
}
return name;
}
var first = randomName(4, 8);
var last = randomName(5, 10);
var biz = randomName(10, 10);
var email = "david.tudury+" + biz + "@voxer.com"
document.getElementById("first_name").value = first;
document.getElementById("last_name").value = last;
document.getElementById("email").value = email;
document.getElementById("confirm_email").value = email;
document.getElementById("password").value = "asdf1234";
document.getElementById("name").value = biz;
document.getElementById("phone").value = randomPhone(10, 10);
var select_users;
if (select_users = document.getElementById("select-users")) {
select_users.value = 10;
}
document.getElementById("first_name").focus();
document.getElementById("last_name").focus();
document.getElementsByClassName("signup-step1")[0].getElementsByClassName("next-button")[0].focus()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment