Skip to content

Instantly share code, notes, and snippets.

@ChazAttack73
ChazAttack73 / README.md
Created December 21, 2015 19:12 — forked from jaywon/README.md
Memoize Me

##Memoize Me We are going to be building an in-memory cache to improve performance and extend the getElementById() and querySelector() functions of the DOM. Querying the DOM for elements can be an inefficient operation and if we are finding elements in the DOM repeatedly we would like to improve performance but we also don't want to clutter our codebase with many variables to hold references to the various elements we will use and to keep things a bit more dynamic.

##Your Challenge Write a module that anyone can add to their project and call your module's functions instead of the native DOM functions.

  1. Use good naming conventions for the module as well as the methods you're exposing. This is subjective to you but put yourself in someone elses shoes of what would make sense to them.
  2. Use memoization to cache elements if they have not been retrieved before from the DOM and return the element just as the above functions would do normally by calling them directly.
  3. If the element has been
@ChazAttack73
ChazAttack73 / README.md
Created December 23, 2015 19:48 — forked from jaywon/README.md
Better Buttons

###The Ask Good morning team! We have been asked to implement a better button for our marketing landing pages in the hopes it leads to more conversions. We currently do one off landing pages for inbound marketing to lead customers to our main brand site. The CEO is demanding that we increase our number of conversions this year and we want something a little more enticing to get users to click.

###Your Challenge Please mock up a simple app with a nice big blue button that when a user hovers over the button grows by 5px in all directions and changes from the dark blue we have on the site to...idk something..."warmer". We also are not sure of the color or sizes we will end up deciding on so the implementation needs to be flexible. Please mock up a prototype for us so we can sell more widgets!!

Any other styling is ok too since you guys are the web masters so impress us.

Thaaaannnks :D

##The Challenge

Write a function that prints a nice Christmas tree of any size to the DOM with it's own star at the top using the shortest code possible. The tree star is an asterisk (*), the tree body is made out of 0 The tree must be at least 10 rows high, and at the bottom of the tree should be a trunk made of 2 pipe characters (|). Every row should be properly indented in the way that the previous row are centered over the next one. Any given row must have 2 more 0s than the previous, except for the first one that is the star and the second, which has only one 0. The result is something like this:

          *
          0
         000
 00000
@ChazAttack73
ChazAttack73 / chirp.md
Created December 28, 2015 19:21 — forked from sgnl/chirp.md
Chirp-Chirp

Getting Started

  • Create your own git repository for this exercise.
  • Commit often with meaningful commit messages.

Goal

Chirp Chirp Chirp Chirp

Specs

Create a function that accepts a single argument which will be a Number. This function will return a string with the word "Chirp" based on the number passed in when invoked.

@ChazAttack73
ChazAttack73 / README.md
Created December 28, 2015 20:25 — forked from sgnl/README.md
Adding Mocha/Chai to your project (morning exercise edition)

Read the docs?

Mocha Chai

In your project directory

  • Initialized git?
  • Initialized npm?

Install Packages

@ChazAttack73
ChazAttack73 / README.md
Created December 29, 2015 02:54 — forked from sgnl/README.md
creating gulp-seed

Setup

  • create a folder for your seed, e.g. es6-sass-seed
  • install Gulp-js: npm install -g gulp
  • initialize npm: npm init
  • save Gulp as a dependency for your project
    • npm install --save-dev gulp or npm install -D gulp
  • create a gulpfile.js at the root of your project directory
  • gulpfile.js should look like this, ex:
@ChazAttack73
ChazAttack73 / README.md
Created December 29, 2015 19:17 — forked from sgnl/README.md
5-day forecast
@ChazAttack73
ChazAttack73 / sorting-algorithms.md
Created December 30, 2015 02:14 — forked from JoeKarlsson/sorting-algorithms.md
Five popular sorting algorithms implemented manually and visualized with DOM manipulation
@ChazAttack73
ChazAttack73 / README.md
Created December 31, 2015 19:14 — forked from sgnl/README.md
GettyImages.com API
@ChazAttack73
ChazAttack73 / throwing-darts.md
Created January 2, 2016 19:12 — forked from sgnl/throwing-darts.md
Throwing Darts

Throwing Darts

You've just recently been hired to calculate scores for a Dart Board game

Scoring Specs

  • 0 points: radius above 10
  • 5 points: radius between 5 and 10 inclusive
  • 10 points: radius less than 5

If all radiuses are less than 5, award 100 BONUS POINTS! An empty array should return 0.