Skip to content

Commit

Permalink
Updating Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Rojas committed Jan 31, 2017
1 parent ad0375c commit 7bdb292
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The code in this repo meant to be a reference point for anyone following along with the video course.

##Demo

URL: Demo: https://ns-rsgznilalc.now.sh/

## To Start

1. Install all the dependencies `npm install`
Expand Down
24 changes: 24 additions & 0 deletions src/helpers-copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export function formatPrice(cents) {
return `$${(cents / 100).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')}`;
}

export function rando(arr) {
return arr[Math.floor(Math.random() * arr.length)];
}

export function slugify(text) {
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}

export function getFunName() {
const adjectives = ['peluca', 'bella', 'sucia', 'chocolate', 'elegante', 'rica', 'golosa', 'pete', 'largo', 'petardo', 'sapeee', 'loquita', 'sapeee', 'peluca', 'trolazo', 'putazo', 'chupapija', 'lechero', 'mcgivergota'];

const nouns = ['mujer', 'hombre', 'niño', 'trolazo', 'loquita', 'gente', 'padre', 'concha', 'prima', 'primo', 'traviesa', 'esposa', 'monja', 'pie', 'enfermera', 'panadero', 'delalora'];

return `${rando(adjectives)}-${rando(adjectives)}-${rando(nouns)}`;
}
4 changes: 2 additions & 2 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function slugify(text) {
}

export function getFunName() {
const adjectives = ['peluca', 'bella', 'sucia', 'chocolate', 'elegante', 'rica', 'golosa', 'pete', 'largo', 'petardo', 'sapeee', 'loquita', 'sapeee', 'peluca', 'trolazo', 'putazo', 'chupapija', 'lechero', 'mcgivergota'];
const adjectives = ['adorable', 'beautiful', 'clean', 'drab', 'elegant', 'fancy', 'glamorous', 'handsome', 'long', 'magnificent', 'old-fashioned', 'plain', 'quaint', 'sparkling', 'ugliest', 'unsightly', 'angry', 'bewildered', 'clumsy', 'defeated', 'embarrassed', 'fierce', 'grumpy', 'helpless', 'itchy', 'jealous', 'lazy', 'mysterious', 'nervous', 'obnoxious', 'panicky', 'repulsive', 'scary', 'thoughtless', 'uptight', 'worried'];

const nouns = ['mujer', 'hombre', 'niño', 'trolazo', 'loquita', 'gente', 'padre', 'concha', 'prima', 'primo', 'traviesa', 'esposa', 'monja', 'pie', 'enfermera', 'panadero', 'delalora'];
const nouns = ['women', 'men', 'children', 'teeth', 'feet', 'people', 'leaves', 'mice', 'geese', 'halves', 'knives', 'wives', 'lives', 'elves', 'loaves', 'potatoes', 'tomatoes', 'cacti', 'foci', 'fungi', 'nuclei', 'syllabuses', 'analyses', 'diagnoses', 'oases', 'theses', 'crises', 'phenomena', 'criteria', 'data'];

return `${rando(adjectives)}-${rando(adjectives)}-${rando(nouns)}`;
}

0 comments on commit 7bdb292

Please sign in to comment.