Skip to content

Instantly share code, notes, and snippets.

View ypyang237's full-sized avatar

Pam ypyang237

  • Melbourne Australia
View GitHub Profile
@ypyang237
ypyang237 / README.md
Created March 26, 2016 19:44 — forked from sgnl/README.md
Setting up SASS (SCSS) files with gulp, gulp-sass, and Browser Sync!

Create a new temp project

  1. $ mkdir sass_gulp_workshop
  2. cd into the new directory
  3. Initialize NPM: $ npm init --yes
  4. Install gulp and gulp-sass packages: $ npm install -D gulp gulp-sass browser-sync
  5. Install gulp globally npm install -g gulp
  6. Recreate this file structure in this directory:
  • public (directory)
    • css (directory)
    • index.html (file)
@ypyang237
ypyang237 / bowlingScoreCalc.js
Last active December 9, 2017 21:50 — forked from sgnl/bowlingScoreCalculator.md
Bowling Score Calculator
function bowlingScoreCalc() {
var P1scoreBoard = [];
var P1score = 0;
var P2score = 0;
var spare = false;
var strike = false;
var pinsDown = 0;
var score = 0;
@ypyang237
ypyang237 / pig-latin-translator.md
Last active March 22, 2016 21:45 — forked from JoeKarlsson/pig-latin-translator.md
Pig Latin Translator

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:

@ypyang237
ypyang237 / README.md
Created March 21, 2016 19:01 — 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

@ypyang237
ypyang237 / palindromeNumberGenerator.md
Last active March 17, 2016 21:20 — forked from sgnl/palindromeNumberGenerator.md
Palindromic Number Generator

Palindromic Number Generator

When given a positive number value, return a palindromic number and how many steps it took to reach that number.

Specs

Create a function named palindromeNumberGenerator which takes a Number value. Check if the number is a Palindromic Number, if it's not then add together the value and the value-reversed and check if the sum is a palindromic number, repeat until you reach a palindromic number value. Each time you sum up the values to get a new number to check, increase the step count by 1.

Input will always be a positive integer.

Example #1

Lets, start with palindromeNumberGenerator(87):

@ypyang237
ypyang237 / stack-challenge.md
Created March 16, 2016 19:05 — forked from jaywon/stack-challenge.md
Use a Linked List to simulate a stack trace

###Console History Sim Stack Trace Challenge

Using a linked list, we are going to demonstrate a use case for a linked list and simulate a stack like you see in a stack trace (similar to what you see in your console when an error occurs), that replays the history of what we typed.

  1. Add a text box to an HTML page and add 2 buttons, save and dump.
  2. Every time the user clicks the first button to save, we are going to save the text input to our linked list as the most recent node or head.
  3. Whenever someone clicks the dump button we are going to dump out all of the input they've typed in to that point from most recent to oldest. This should be written as HTML to the page.
@ypyang237
ypyang237 / Ruh-Roh.md
Created March 11, 2016 19:03 — forked from jaywon/Ruh-Roh.md
Email Hell

###Email Hell

We just found out that there is a bug in production that our e-mail function was iterating errantly and sending duplicate e-mails to many users. We need to fix this quickly but we don't want to send out a mass apology letter to all of our users.

Our sysadmin gave us the SMTP logs and we need to process the logs and identify which users received multiple e-mails so that we can directly send them a follow up e-mail explaining the situation and offer super cool swag to keep them on as customers.

Also, the boss wants this done ASAP, we don't have time to do this manually...HAAALLLLPPP!

###The Fix

@ypyang237
ypyang237 / gist:32ad7ba1c7030f651ddc
Created March 10, 2016 19:10 — forked from jaywon/gist:c76abc57dc33e1679c02
Circular String Brain Bender

###Good Morning Agents

Your challenge this morning is to create a function that implements an algorithm using the concepts we've covered this week.

###Challenge

  1. Write an algorithm that takes in 2 strings as parameters (source, find).
  2. Your function should return true if the string passed in as the find parameter is found in the source parameter if source were circular in nature. Meaning there is no end to the source string.
  3. Important: A match would be true if the word to find is partially at the end of the word and at the beginning in sequence.

Ex.