Example #1
0
faker.internet.rgbColor = () => {
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(faker.internet.color());
  return [
    parseInt(result[1], 16),
    parseInt(result[2], 16),
    parseInt(result[3], 16)
  ];
};
Example #2
0
function dummyFolder (override = {}) {
  var data = {
    name: faker.lorem.word(),
    color: faker.internet.color()
  }
  if (override.key == null) data.key = keygen()

  Object.assign(data, override)

  return data
}
app.get('/api/fake/internet', function(req, res) {
	res.json([
		{
			avatar: faker.internet.avatar(),
			email: faker.internet.email(),
			exampleEmail: faker.internet.exampleEmail(),
			userName: faker.internet.userName(),
			protocol: faker.internet.protocol(),
			url: faker.internet.url(),
			domainName: faker.internet.domainName(),
			domainSuffix: faker.internet.domainSuffix(),
			domainWord: faker.internet.domainWord(),
			ip: faker.internet.ip(),
			userAgent: faker.internet.userAgent(),
			color: faker.internet.color(),
			mac: faker.internet.mac(),
			password: faker.internet.password()
		}
	])
});
Example #4
0
          (function addNextTribe(tribeIndex) {
            var tribe = new Tribe();

            tribe.label = faker.lorem.word() + '_' + (tribes.length + tribeIndex);
            tribe.labelHistory = faker.random.words();
            tribe.slugHistory = faker.random.words();
            tribe.synonyms = faker.random.words();
            tribe.color = faker.internet.color().slice(1);
            tribe.count = 0;
            tribe.created = Date.now();
            tribe.modified = Date.now();
            tribe.public = true;
            tribe.image_UUID = _.sample(tribeImageUUIDs);
            tribe.attribution = faker.name.findName();
            tribe.attribution_url = faker.internet.url();
            tribe.description = faker.lorem.sentences();

            tribe.save(function (err) {
              if (err != null) {
                console.log(err);
              }
              else {
                process.stdout.write('.');
                savedTribes += 1;
                if ((limit && (savedTribes + tribes.length >= max))
                    || !limit && ((savedTribes >= max))) {
                  console.log('');
                  console.log(chalk.green(tribes.length + ' tribes existed in the database.'));
                  console.log(chalk.green(savedTribes + ' tribes successfully added.'));
                  console.log(chalk.green('Database now contains ' + (tribes.length + savedTribes) + ' tribes.'));
                  console.log(chalk.white('')); // Reset to white
                  process.exit(0);
                }
              }
            });
          }(index));
Example #5
0
  color: '#c32c32',
  length: 12,
  type: 3,
  key: 'private',
};

const profiles = [profile];
for (let i = 0; i < 3; i++) {
  profiles.push({
    id: uuid.v4(),
    default: false,
    type: PASSWORD_TYPES.SPECIAL,
    length: 12,
    key: uuid.v4(),
    name: faker.random.word(),
    color: faker.internet.color(),
  });
}

storiesOf('popup.quickstate', module)
  .add('Site disabled', () =>
    <QuickState
      currentProfile={'uuid'}
      profiles={profiles}
      enabled={false}
      onToggle={action('toggle state')}
      onProfileChange={action('profile change')}
    />
  )
  .add('Site enabled', () =>
    <QuickState
Example #6
0
	users: (function() {
		let res = [];
		for (let i = 0; i < 5; i++) {
			let lang = faker.helpers.randomize(['en-US', 'en-GB', 'de', 'fr', 'it']);
			//faker.locale = lang;
			let user = faker.helpers.createCard();
			user.id = i + 1;
			user.type = faker.helpers.randomize(["personal", "business"]);
			user.password = faker.internet.password(10);
			user.bio = faker.lorem.paragraph();
			let dob = faker.date.past(40, "1998-01-01");
			user.dob = dob.valueOf();
			user.time = moment().format("hh:mm:ss");
			user.age = moment().year() - moment(dob).year();
			user.rank = faker.random.number({
				min: 1,
				max: 10
			});
			user.role = faker.helpers.randomize(roles).id;
			//user.mobile = faker.phone.phoneNumber();
			user.avatar = faker.internet.avatar();

			user.skills = [];
			user.skills.push(faker.helpers.randomize(skills));
			user.skills.push(faker.helpers.randomize(skills));

			user.language = lang;
			user.status = faker.helpers.randomize([true, false, true]);
			user.created = faker.date.recent(30).valueOf();
			user.dt = faker.date.recent(30).valueOf();
			user.favoriteColor = faker.internet.color();

			if (user.type == "business") {
				user.company = {
					"name": faker.company.companyName(),
					"catchPhrase": faker.company.catchPhrase(),
					"bs": faker.company.bs(),
					"website": faker.internet.domainName(),
					"phone": faker.phone.phoneNumber(),
					"address": {
						"street": faker.address.streetAddress(),
						"city": faker.address.city(),
						"country": faker.address.country(),
						"zipcode": faker.address.zipCode(),
						"geo": {
							"lat": faker.address.latitude(),
							"lng": faker.address.longitude()
						}
					}

				}
			} else {
				user.company = undefined;
			}

			user.posts = undefined;
			user.accountHistory = undefined;

			res.push(user);
			//console.log(user);
		}
		//console.log(res);
		return res;
	})()
app.get('/api/fake', function(req, res) {
	res.json({
		"address": {
			zipCode: faker.address.zipCode(),
			city: faker.address.city(),
			cityPrefix: faker.address.cityPrefix(),
			citySuffix: faker.address.citySuffix(),
			streetName: faker.address.streetName(),
			streetAddress: faker.address.streetAddress(),
			streetSuffix: faker.address.streetSuffix(),
			streetPrefix: faker.address.streetPrefix(),
			secondaryAddress: faker.address.secondaryAddress(),
			county: faker.address.county(),
			country: faker.address.country(),
			countryCode: faker.address.countryCode(),
			state: faker.address.state(),
			stateAbbr: faker.address.stateAbbr(),
			latitude: faker.address.latitude(),
			longitude: faker.address.longitude()
		},
		"commerce": {
			color: faker.commerce.color(),
			department: faker.commerce.department(),
			productName: faker.commerce.productName(),
			price: faker.commerce.price(),
			productAdjective: faker.commerce.productAdjective(),
			productMaterial: faker.commerce.productMaterial(),
			product: faker.commerce.product()
		},
		"company": {
			suffixes: faker.company.suffixes(),
			companyName: faker.company.companyName(),
			companySuffix: faker.company.companySuffix(),
			catchPhrase: faker.company.catchPhrase(),
			bs: faker.company.bs(),
			catchPhraseAdjective: faker.company.catchPhraseAdjective(),
			catchPhraseDescriptor: faker.company.catchPhraseDescriptor(),
			catchPhraseNoun: faker.company.catchPhraseNoun(),
			bsAdjective: faker.company.bsAdjective(),
			bsBuzz: faker.company.bsBuzz(),
			bsNoun: faker.company.bsNoun()
		},
		"date": {
			past: faker.date.past(),
			future: faker.date.future(),
			between: faker.date.between(),
			recent: faker.date.recent(),
			month: faker.date.month(),
			weekday: faker.date.weekday()
		},
		"finance": {
			account: faker.finance.account(),
			accountName: faker.finance.accountName(),
			mask: faker.finance.mask(),
			amount: faker.finance.amount(),
			transactionType: faker.finance.transactionType(),
			currencyCode: faker.finance.currencyCode(),
			currencyName: faker.finance.currencyName(),
			currencySymbol: faker.finance.currencySymbol(),
			bitcoinAddress: faker.finance.bitcoinAddress()
		},
		"hacker": {
			abbreviation: faker.hacker.abbreviation(),
			adjective: faker.hacker.adjective(),
			noun: faker.hacker.noun(),
			verb: faker.hacker.verb(),
			ingverb: faker.hacker.ingverb(),
			phrase: faker.hacker.phrase()
		},
		"helpers": {
			randomize: faker.helpers.randomize(),
			slugify: faker.helpers.slugify(),
			replaceSymbolWithNumber: faker.helpers.replaceSymbolWithNumber(),
			replaceSymbols: faker.helpers.replaceSymbols(),
			shuffle: faker.helpers.shuffle(),
			mustache: faker.helpers.mustache(),
			createCard: faker.helpers.createCard(),
			contextualCard: faker.helpers.contextualCard(),
			userCard: faker.helpers.userCard(),
			createTransaction: faker.helpers.createTransaction()
		},
		"image": {
			image: faker.image.image(),
			avatar: faker.image.avatar(),
			imageUrl: faker.image.imageUrl(),
			abstract: faker.image.abstract(),
			animals: faker.image.animals(),
			business: faker.image.business(),
			cats: faker.image.cats(),
			city: faker.image.city(),
			food: faker.image.food(),
			nightlife: faker.image.nightlife(),
			fashion: faker.image.fashion(),
			people: faker.image.people(),
			nature: faker.image.nature(),
			sports: faker.image.sports(),
			technics: faker.image.technics(),
			transport: faker.image.transport()
		},
		"internet": {
			avatar: faker.internet.avatar(),
			email: faker.internet.email(),
			exampleEmail: faker.internet.exampleEmail(),
			userName: faker.internet.userName(),
			protocol: faker.internet.protocol(),
			url: faker.internet.url(),
			domainName: faker.internet.domainName(),
			domainSuffix: faker.internet.domainSuffix(),
			domainWord: faker.internet.domainWord(),
			ip: faker.internet.ip(),
			userAgent: faker.internet.userAgent(),
			color: faker.internet.color(),
			mac: faker.internet.mac(),
			password: faker.internet.password()
		},
		"lorem": {
			word: faker.lorem.word(),
			words: faker.lorem.words(),
			sentence: faker.lorem.sentence(),
			sentences: faker.lorem.sentences(),
			paragraph: faker.lorem.paragraph(),
			paragraphs: faker.lorem.paragraphs(),
			text: faker.lorem.text(),
			lines: faker.lorem.lines()
		},
		"name": {
			firstName: faker.name.firstName(),
			lastName: faker.name.lastName(),
			findName: faker.name.findName(),
			jobTitle: faker.name.jobTitle(),
			prefix: faker.name.prefix(),
			suffix: faker.name.suffix(),
			title: faker.name.title(),
			jobDescriptor: faker.name.jobDescriptor(),
			jobArea: faker.name.jobArea(),
			jobType: faker.name.jobType()
		},
		"phone": {
			phoneNumber: faker.phone.phoneNumber(),
			phoneNumberFormat: faker.phone.phoneNumberFormat(),
			phoneFormats: faker.phone.phoneFormats()
		},
		"random": {
			number: faker.random.number(),
			arrayElement: faker.random.arrayElement(),
			objectElement: faker.random.objectElement(),
			uuid: faker.random.uuid(),
			boolean: faker.random.boolean(),
			word: faker.random.word(),
			words: faker.random.words(),
			image: faker.random.image(),
			locale: faker.random.locale(),
			alphaNumeric: faker.random.alphaNumeric()
		},
		"system": {
			fileName: faker.system.fileName(),
			commonFileName: faker.system.commonFileName(),
			mimeType: faker.system.mimeType(),
			commonFileType: faker.system.commonFileType(),
			commonFileExt: faker.system.commonFileExt(),
			fileType: faker.system.fileType(),
			fileExt: faker.system.fileExt(),
			directoryPath: faker.system.directoryPath(),
			filePath: faker.system.filePath(),
			semver: faker.system.semver()
		}
	})
});