Skip to content

Instantly share code, notes, and snippets.

@rastalamm
rastalamm / unstrict.js
Last active August 29, 2015 14:22 — forked from theRemix/unstrict.js
'use strict';
var dogs = {
smallest : 'chihuahua',
small : 'dachshund'
};
var bird = true;
var cats = {
big_cat: 'tiger',

###Good Morning - June 1, 2015

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

###Challenge

  1. Write an algorithm that takes in 2 strings(source, find).
  2. Return true if the word passed in as the find parameter is in the source if it were circular. Meaning there is no end to source word. 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.

###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 that replays the history of what we typed.

  1. Add a text box to an HTML page and a 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.
@rastalamm
rastalamm / Ruh-Roh.md
Last active August 29, 2015 14:22 — 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

CSS Selector

Hello Awesome Programmer Person, My name is Ray and I need a tool built that will help other students visualize how CSS Selectors work. This tool can be added to any HTML document you have. This tool should:

  1. Provide a way for a user to input CSS selector code into a form or something. I think they look like #header or sometimes .messages I dont know, you know CSS right?
  2. After the user submits the CSS code, your tool will highlight all the HTML things that it finds. Maybe a Yellow Background color? Something bright!
  3. If the tool doesn't find anything, maybe let the user know somehow? I dont know, it's up to you.
  4. Maybe practice on your own HTML file.

Someone made this, I think you could make it better

@rastalamm
rastalamm / README.md
Last active August 29, 2015 14:25 — forked from thgaskell/README.md

Gulp + Sass + LiveReload

Goals

To have a gulp workflow that with a single process,

  1. watches for any sass changes, then compiles sass source into css
  2. watches for any changes in the public directory, triggers live-reload
  3. serves your static content in public/
@rastalamm
rastalamm / gist:5e68e3db2a48984189b1
Created July 18, 2015 20:15
Creating keep Alive Agent if you run into the 'EADDRNOTAVAIL' problem. (You ran out of sockets)
var keepAliveAgent = new http.Agent({
keepAlive: true,
keepAliveMsecs : 200 });
var options = {
hostname : HOST,
port : PORT,
method : 'POST',
agent : keepAliveAgent
}
@rastalamm
rastalamm / README.md
Last active August 29, 2015 14:25 — forked from thgaskell/README.md
Basic Authentication with Passport

Basic Authentication with Passport

Basic authentication is one of the simplest authentication strategies because it doesn't require cookies, sessions, or even a login form! Instead, it uses HTTP headers which means credentials are transmitted on each request.

Installation

You will need to install passport and passport-http. The passport-http module is what allows you set up the Basic Authentication Scheme, in addition to a couple other authentication strategies.

$ npm install express passport passport-http --save
@rastalamm
rastalamm / intro-mongo.md
Last active August 29, 2015 14:26 — forked from sgnl/intro-mongo.md
MongoDB... COME ON DOOOOOOOWN

Before starting run the commands brew doctor and then brew update

Unix Users please install using the docs

Install Mongodb via Homebrew

$ brew install mongodb

Once brew is done installing, take note of the Caveats section that is printed to your console. Just like what we did previously for postgres it might be best to create a symlink then two aliases to start and stop the mongo progress.

  • Start your mongodb service