Skip to content

Instantly share code, notes, and snippets.

View kentsalcedo's full-sized avatar
🎯
Focusing

Kent Salcedo kentsalcedo

🎯
Focusing
View GitHub Profile
@kentsalcedo
kentsalcedo / pulling-and-pushing-to-git.md
Last active September 9, 2015 08:15 — forked from jtallant/pulling-and-pushing-to-git.md
Basic Unix + Pulling and Pushing to Git

UNIX Commands

pwd present working directory

ls list current directory contents

ls -la list current directory contents in long format and show hidden files

man <some unix command> Bring up the manual pages for a command. Type q to exit

@kentsalcedo
kentsalcedo / gist:8450d62059d944b3f207
Created December 3, 2015 19:04 — 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.

@kentsalcedo
kentsalcedo / Ruh-Roh.md
Created December 4, 2015 19:16 — 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

@kentsalcedo
kentsalcedo / stack-challenge.md
Created December 9, 2015 19:03 — 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.
@kentsalcedo
kentsalcedo / README.md
Created December 14, 2015 19:02 — 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

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:

@kentsalcedo
kentsalcedo / gulp-scss-livereload.md
Created December 20, 2015 00:19 — 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.

@kentsalcedo
kentsalcedo / 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
@kentsalcedo
kentsalcedo / README.md
Created December 23, 2015 19:07 — 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

@kentsalcedo
kentsalcedo / hanoi.md
Created January 12, 2016 19:15
The Temple of Hanoi - Recursive morning challenge

##Tower Of Hanoi

According to legend, there is a temple in Hanoi where are located sixty-four golden rings of graduated sizes and three diamond towers. Each day, the monks of the temple move a ring from one tower to another according to the rule that only one ring may be moved each day, that a single move consists of taking the highest ring from one tower and placing it on another tower, and that no ring may be placed on top of a smaller ring. The rings and towers were placed at the beginning of the world, and the monks have toiled through the ages to move all the rings from the designated starting tower to the designated finishing tower, at each day making the move that minimizes the total number of moves required. The world will end when the monks complete their work.

The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:

  1. Only one disk can be moved at a time.

  2. Each move consists of taking the upper disk from one of the stacks and placing it on to