Skip to content

Instantly share code, notes, and snippets.

@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.

##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 / 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

@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 / gulp-scss-livereload.md
Created December 20, 2015 00:20 — forked from sgnl/gulp-scss-livereload.md
Gulp + SCSS + LiveReload - Updated 12/18/2015

Gulp + SCSS + LiveReload

This Gist outlines the gulp workflow that will:

  1. watch for any scss changes, then compiles scss source into css
  2. watch for any changes in the public directory, and trigger live-reload
  3. serve static content in public/

This Gist also assumes you already know how to install npm modules, gitignore, create directories and create files via the command line.

$git init
$npm init --yes
$npm install -g mocha (only need to do once)
$mkdir test
$touch test/pig_latin.spec.js //mocha looks for a test folder with a file that has the extension spec
//in your pig_latin.spec.js file insert the following
var chai = require('chai');
var expect = chai.expect;
chai.should();
var pigLatin = require('./../index.js');

Pig Latin Translator

A new alien species has moved to earth and they only speak pig-latin! The president has called you and says that they need your help!

Your mission is to create a module that is capable of taking an english sentence and translating it into pig latin. We must also be able to understand what our new alien friends are saying, so the module needs to be able to convert pig-latin back to english.

TL;DR: Create a module that translates a string into Pig Latin, and is capable of translating Pig Latin back into in the native language.

##How Pig Latin Works Basically, the Pig Latin system used here works as follows:

@ChazAttack73
ChazAttack73 / README.md
Created December 15, 2015 19:07 — forked from jaywon/README.md
Analytics Tracking

###Business Objective Good morning team! We just got a request from the new CMG(Chief Marketing Groovru) that he wants to start A/B testing every element across the entire site for user interaction. We are going to need you to create a script that can be included in an HTML page that tracks every click on a page and reports what element was clicked so that we know at a micro level how users are interacting with our new optimized, user-friendly, uber-engagement platform.

###Your Task Mock up a simple HTML page with a bunch of different elements on the page and create a script that tracks every single element clicked and the number of times it was clicked. We will worry about saving this to our analytics database later, we just need a way to prove that it works.

Thaaannnks :D

@ChazAttack73
ChazAttack73 / bowlingScoreCalculator.md
Created December 15, 2015 19:07 — forked from sgnl/bowlingScoreCalculator.md
Bowling Score Calculator

Bowling Score Calculator

Your task is to write a function for calculating the score of a 10 pin bowling game. The input for the function is a list of pins knocked down per roll for one player. Output is the player's total score.

General rules

Rules of bowling in a nutshell:

A game consists of 10 frames. In each frame the player rolls 1 or 2 balls, except for the 10th frame, where the player rolls 2 or 3 balls. The total score is the sum of your scores for the 10 frames

  • If you knock down fewer than 10 pins with 2 balls, your frame score is the number of pins knocked down
@ChazAttack73
ChazAttack73 / add-upstream.md
Created December 12, 2015 00:05 — forked from sgnl/add-upstream.md
So you've forked a Repository and you want updates...

#tl;dr

setting up a branch to track a repo

pre: assuming you have forked a repo and cloned your fork to your computer

  1. git remote add [maintainer's name] [paste URL here]
  2. git fetch --all
  3. git branch --track [maintainer's name]_[branch] [remote name from step 1]/[branch you want to track] At this point you may watch to checkout to your newly create branch and issue a git pull command.