Skip to content

Instantly share code, notes, and snippets.

View scottmascio2115's full-sized avatar

Scott Mascio scottmascio2115

View GitHub Profile
@scottmascio2115
scottmascio2115 / recursive_methods.rb
Created August 11, 2013 21:29
recursive_methods.rb
def choose_team(n, k)
return n if k == 1
return 0 if n == 0
choose_team(n-1, k-1) + choose_team(n-1,k)
end
puts choose_team(6,3) == 20
puts choose_team(6,2) == 15
puts choose_team(24,4) == 10626
# 1. Describe
# Contianer- A container is is simply a place to contain a collection of other objects
# They are used for storing objects in a specific way under set rules.
# ------------
# 2. Implement a container with all even numbers from 1..100
def container(array)
ray = Array.new
array.each do |x|
if x % 2 == 0
# 1: Grab a solution to Roman Numerals
#
# Source: https://gist.github.com/leeacto/ece0c63cfda0d022b536
# Author: Nick lee
# ------------
# 2. Explain the code in plain English
# Given a number, translate that number into a roman numeral.
# You have to create a set of numbers. The assign those numbers letters.
#Take your original number and run it through the set of numbers.
@scottmascio2115
scottmascio2115 / reflect_on_learning.md
Created August 11, 2013 22:43
reflect_on_learning.

List 10 topics

  1. Driver code
  2. Recursion
  3. Looping
  4. Enumerables
  5. Arrays
  6. Ping pong pairing
  7. Debugging
  8. Pseudocode
  9. Refactoring
@scottmascio2115
scottmascio2115 / racer_utils.rb
Last active December 20, 2015 22:48
Ruby Racer 2
class Die
def initialize(sides = 6)
@sides = sides
end
# Remember: rand(N) randomly returns one of N consecutive integers, starting at 0
# So rand(N) returns a random integer in (0..N-1)
# And 1 + rand(N) returns a random integer in (1..N)
# See: http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-rand
def roll
@scottmascio2115
scottmascio2115 / reflect_iterate.rb
Created August 12, 2013 12:22
reflect and iterate
# Feel free to ask other people to explain things to you.
#Remember, your understanding is the most important part.
# Include links to all three gists here. Ruby_Racer && Sudoku
# 1. https://gist.github.com/tarynsauer/d6e99f07b25a429cd755
# 2.https://gist.github.com/nlprater/c2af4e1ff3b7074252f6
# 3.https://gist.github.com/bahrieinn/65aee31bb545bbb089f9
# Now, redo your most difficult week review challenge.
@scottmascio2115
scottmascio2115 / index.html
Created September 26, 2013 00:35 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@scottmascio2115
scottmascio2115 / index.html
Last active December 24, 2015 00:09 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@scottmascio2115
scottmascio2115 / zoo.js
Last active December 24, 2015 00:19 — forked from dbc-challenges/zoo.js
function Animal (name, legs) {
this.name = name;
this.legs = legs;
}
Animal.prototype.identify = function() {
console.log("I am a" + this.name "with 2 legs." "," this.name "have" +this.legs "legs");
};
defmodule Todo do
use GenServer
## Client side code
def start(tasks \\ "") do
{:ok, pid} = GenServer.start(__MODULE__, tasks)
pid
end
def add_task(pid, task) do