- Driver code
- Recursion
- Looping
- Enumerables
- Arrays
- Ping pong pairing
- Debugging
- Pseudocode
- Refactoring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Creation of an opposite macro | |
We want opposite 1 + 1 | |
to return to 0 or essentially run 1 - 1 | |
opposite 1 + 1 | |
Transforms 1 + 1 into an AST | |
opposite({:+, [], [1,1]} | |
Our macro would then transform that AST (Abstract syntax tree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Distributed code using Nodes | |
# Elixir docs http://elixir-lang.org/getting-started/mix-otp/distributed-tasks-and-configuration.html | |
# This blog post http://benjamintan.io/blog/2014/05/25/connecting-elixir-nodes-on-the-same-lan/ | |
iex --sname foo | |
Results in | |
foo@computer-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
NewerOlder