Skip to content

Instantly share code, notes, and snippets.

View sgnl's full-sized avatar
🍪
Do you agree to share your cookies?

Ray Farias sgnl

🍪
Do you agree to share your cookies?
  • Honolulu, Hawaii
View GitHub Profile

Rock Paper Fireball

The Game

Rock paper fireball is a classic 2 player game.
Each player chooses either rock, paper or fireball.
The possible outcomes:

  • Rock blocks fireball.
  • Fireball engulfs paper.
  • Paper covers rock.
Description:
A bookseller has lots of books classified in 26 categories labeled A, B, ... Z. Each book has a code c of 3, 4, 5 or more capitals letters. The 1st letter of a code is the capital letter of the book category. In the bookseller's stocklist each code c is followed by a space and by a positive integer n (int n >= 0) which indicates the quantity of books of this code in stock.
In a given stocklist all codes have the same length and all numbers have their own same length (can be different from the code length).
For example an extract of one of the stocklists could be:
L = ["ABART 20", "CDXEF 50", "BKWRK 25", "BTSQZ 89", "DRTYM 60"].
@sgnl
sgnl / keybase.md
Created May 27, 2015 00:46
keybase.md

Keybase proof

I hereby claim:

  • I am sgnl on github.
  • I am sgnl (https://keybase.io/sgnl) on keybase.
  • I have a public key whose fingerprint is 21FD 1D94 7C20 9219 92F1 C6BC 7CD8 44D2 B2FC 18F0

To claim this, I am signing this object:

@sgnl
sgnl / app.js
Last active August 29, 2015 14:22
//app.js
var config = require('./config.json');
var express = require('express');
var app = express();
app.use(express.static('public'));
app.get('/', function (request, response) {
response.send('Hello, World!');
});
@sgnl
sgnl / Ruh-Roh.md
Last active August 29, 2015 14:22 — forked from jaywon/Ruh-Roh.md

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

@sgnl
sgnl / quickgit.md
Last active August 29, 2015 14:23
Push all teh repoz
  • Navigate to the folder of the exercise/project you want to update your github with.
  • Make sure it is being tracked by GIT by entering the command: git status. If you get a resonse then you're good to go. If you get an error message then create a repository for this project by clicking here (be signed into your github account)
  • Add any unstaged files to be committed, unstaged files appear RED: as shown here
  • Add files to be committed, you can add files one at a time
    git add fineNameHere.js
    git add directoriesAreGoodToo/
    git add multipleFiles.css AndFolders/ CanBe/Separated.js BySpaces.css
@sgnl
sgnl / css-selector.md
Last active August 29, 2015 14:23
CSS Selector Challenge

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

@sgnl
sgnl / validation.md
Last active August 29, 2015 14:23
Express Middleware Exercise - Validation

Express Middleware Exercise - Validation

Your job is to add validations to the messages being posted to your Chatroom Application's Server by implementing Middleware.

Each validation requirement below will be it's own middleware in the series.

Commit your code each time you successfully implement a new middleware handler.

Validation Requirements

Payload

@sgnl
sgnl / signup.md
Last active August 29, 2015 14:23
Build A Sign Up For Our Startup

The pitches have completed. You and your team have decided on the technologies and the tech lead has already begun hacking away. The Biz Dev approaches you and whispers two words, "User Acquisition". You can already feel the pressure...

Hey so like, we need to go out to the Night Market and start polling for opinions on our service. I already bought the domain and so I just need you to build the sign-up form so we can gather emails. Should be easy right? Cool. Oh, I need this done ASAP because I'm leaving for the market now. Thaaaaaanks :D

Goal

You have been tasked to build the landing page which will have a Sign Up Form. User's will visit the page, be asked to enter their first and last name, and email address. Then the User will be presented with a thank you message. You must use ExpressJS, implement some basic validations on the data coming in, and do this quick!

Requirements

Your Form will POST data to your '/signup' endpoint. No XHR will be used.