- ReactRails
- Deep dive into the rails asset pipeline (sprockets & asset compilation)
- Setting up your environment (RVM/RBENV, various installer tools)
- What are design patterns
- Draper & the decorator pattern
- Data structures
- Blocks & how yield works
- Efficient ruby. writing ruby that runs faster
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 TrumpSort | |
def initialize(arr) | |
@arr = arr | |
@wall = nil | |
@sorted = [] | |
end | |
def sort | |
@arr.each {|n| looper(n)} | |
@sorted |
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 TrumpSort do | |
def sort([h|tail]) do | |
[ h | sort(tail,h) ] | |
end | |
def sort([], _wall) do | |
[] | |
end | |
def sort([h|tail], wall) when h > wall 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
-module(two_15). | |
-export([palindrome/1]). | |
palindrome(String)-> | |
Fs = formattedString(String), | |
Fs == lists:reverse(Fs). | |
formattedString(String) -> | |
% remove all spaces & non-word chars | |
re:replace(string:to_lower(String), "\\s+|\\W", "", [global,{return,list}]). |
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
-module (two_nine). | |
-export ([double/1,evens/1,median/1,modes/1]). | |
double([H]) -> [H * 2]; | |
double([H|T]) -> | |
[H * 2 | double(T)]. | |
evens([H]) when 0 == H rem(2) -> [H]; | |
evens([H|T]) -> |
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
-module(bits). | |
-export([bits/1,tests/0]). | |
bits(N) when N >= 0 -> | |
% convert N into a base 2 list then back into a base 10 number | |
bits(list_to_integer(integer_to_list(N,2)),0). | |
bits(0, Acc) -> Acc; | |
bits(N,Acc) -> |
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
-module(shapes). | |
-export([area/1, enclose/1, perimeter/1, tests/0]). | |
% The area, enclose , and perimeter functions each take a tuple | |
% formatted {shape, {dimensions}}. The functions pattern match | |
% against the shape atom and use the dimensions to do the calculations. | |
% At the bottom of the file there is a test/0 function that | |
% calls functions to test the math of the various calculations |
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> | |
<meta charset="utf-8"/> | |
<title>Pure React Example</title> | |
</head> | |
<body> | |
<div id="react-container"> | |
<!-- This is the div react is binding to --> | |
</div> |
- functional programming language
- data is imutable
- key philosophy is everything runs around data transformations not mutating and managing state
- pass returned value from function to function never changing the value of the original input
- funcitons should take an input & always return the same value like a math formula
- uses pattern matching for function calling
- used to assign variables in the function
- multiple function declerations and determines what version shold get called based on the params matching
NewerOlder