Skip to content

Instantly share code, notes, and snippets.

View rfprod's full-sized avatar
☯️

Vadim rfprod

☯️
View GitHub Profile
@rfprod
rfprod / Game of Life.markdown
Last active April 22, 2017 15:50
Game of Life
@rfprod
rfprod / Recipe Box.markdown
Last active July 3, 2017 14:03
Recipe Box

Recipe Box

User can:

  • create recipes that have names and ingredients;
  • see an index view where the names of all the recipes are visible;
  • click into any of those recipes to view it;
  • edit these recipes;
  • delete these recipes. All new recipes User adds are saved in user's browser's local storage. If user refreshes the page, these recipes will still be there.
@rfprod
rfprod / FreeCodeCamp Leaderboard.markdown
Last active April 22, 2017 15:51
FreeCodeCamp Leaderboard

FreeCodeCamp Leaderboard

A table of the Free Code Camp campers who've earned the most brownie points in the past 30 days. User can see how many brownie points they've earned in the past 30 days, and how many they've earned total. User can toggle between sorting the list by how many bronwie points they've earned in the past 30 days and by how many brownie points they've earned total.

A Pen by V on CodePen.

License.

@rfprod
rfprod / Markdown Previewer.markdown
Last active August 22, 2024 01:11
Markdown Previewer

Markdown Previewer

User can type GitHub-flavored Markdown into a text area and see a preview of the output of input that is updated as user types.

A Pen by V on CodePen.

License.

@rfprod
rfprod / FriendlyDate.markdown
Last active April 22, 2017 15:51
Friendly Date

Friendly Date Ranges

Converts two dates into a more friendly date range that could be presented to a user. It does not show any redundant information in the date range. If the year and month are the same then only the day range should be displayed. If the starting year is the current year, and the ending year can be inferred by the reader, the year should be omitted. Input date format is YYYY-MM-DD

A script by V.

@rfprod
rfprod / StringPermutationsNoCharRepeats.markdown
Last active April 22, 2017 15:51
String Permutations With No Character Repeats

String Permutations With No Character Repeats

Returns the number of total permutations of the provided string that don't have repeated consecutive letters. In this particular case number of permutations for, for example, 3-character string equals !3 = 3 * 2 * 1 = 6. For example, 'aab' should return 2 because it has 6 total permutations, but only 2 of them don't have the same letter (in this case 'a') repeating.

A script by V.

License.

@rfprod
rfprod / InventoryUpdate.markdown
Last active April 22, 2017 15:52
Inventory Update

Inventory Update

Function compares and updates inventory stored in a 2d array against a second 2d array of a fresh delivery. It updates current inventory item quantity, and if an item cannot be found, adds the new item and quantity into the inventory array in alphabetical order.

A script by V.

License.

@rfprod
rfprod / ExactChange.markdown
Last active April 22, 2017 15:52
Exact Change

Exact Change

A cash register drawer function that accepts purchase price as the first argument, payment as the second argument, and cash-in-drawer (cid) as the third argument. cid is a 2d array listing available currency. Function returns the string "Insufficient Funds" if cash-in-drawer is less than the change due, the string "Closed" if cash-in-drawer is equal to the change due. Otherwise, it returns change in coin and bills, sorted in highest to lowest order.

A script by V.

License.

@rfprod
rfprod / SymmetricDifference.markdown
Last active April 22, 2017 15:52
Symmetric Difference

Symmetric Difference

Function takes two or more arrays and returns an array of the symmetric difference of the provided arrays - (((A∆B)∆C)∆...)∆Nn.

The mathematical term symmetric difference refers to the elements in two sets that are in either the first or second set, but not in both.

(A∆B)∆C - comprehensive explanation

A script by V.

@rfprod
rfprod / TelephoneNumberValidator.markdown
Last active April 22, 2017 15:52
Telephone Number Validator

Telephone Number Validator

Function returns true if the passed string is a valid US phone number, otherwise false. If the country code is provided, function checks if the country code is 1. The following are all valid formats for US numbers: 555-555-5555 (555)555-5555 (555) 555-5555 555 555 5555 5555555555