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
forrestparker@Ferdinand ForrestPortfolio (master) $host forrestaparker.com | |
forrestaparker.com has address 8.5.1.1 | |
forrestaparker.com mail is handled by 10 p.nsm.ctmail.com. | |
forrestparker@Ferdinand ForrestPortfolio (master) $dig www.forrestaparker.com | |
; <<>> DiG 9.8.3-P1 <<>> www.forrestaparker.com | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18405 |
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
development: | |
adapter: sqlite3 | |
database: development | |
pool: 5 | |
timeout: 5000 | |
production: | |
adapter: mysql | |
database: depot_production | |
encoding: utf8 |
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
require 'test_helper' | |
feature 'Deleting a Project' do | |
scenario 'Project is deleted with a click' do | |
visit projects_path | |
page.find("div#project_nav_project_1").click_on 'Destroy' | |
page.text.must_include 'Project was successfully deleted.' | |
page.wont_have_content 'Code Fellows Portfolio' | |
end | |
end |
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
<h2>My Portfolio</h2> | |
<ul> | |
<% @projects.each do |project| %> | |
<li class="project" id="<%= dom_id(project) %>"> | |
<h3><%= project.name %></h3> | |
<p><%= project.technologies_used %></p> | |
<div class="project_nav", id="project_nav_<%= dom_id(project)%>" > | |
<%= link_to 'Show', project %> | | |
<%= link_to 'Edit', edit_project_path(project) %> | | |
<%= link_to 'Destroy', project, method: :delete, data: { confirm: 'Are you sure?' } %> |
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 Warshall | |
def initialize(adjacencyMatrix) | |
@adjacencyMatrix=adjacencyMatrix | |
end | |
def getPathMatrix | |
numNodes=@adjacencyMatrix[0].length | |
pathMatrix=Array.new(@adjacencyMatrix) | |
for k in 0...numNodes | |
for i in 0...numNodes |
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
ANGULAR VOCABULARY: | |
Scope: The range that an object may be accessed. | |
Controller: The logic behind views of sectoins of the DOM Tree | |
Data Binding: Syncs data between the model and view | |
Dependency Injection: Writes and connects objects to the dom |
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 Queue | |
attr_accessor :data, :next, :head, :tail, :size | |
def enqueue (data) | |
@data = data | |
if head.nil? | |
@head = @data | |
@tail = @data | |
@size = 1 |
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
# First a primer on Meta Programming: | |
Meta programming happens all the time under the surface. You are meta programming whenever you are writting code that operates on code rather then data. A great example in Ruby is anytime you use a generator, you are using a bit of code to write new code. This is metaprogramming. But of course we can use meta programming outside of just using a generator. A great example is the String Class, out of the box it doesn't have a way to split a sentence into individual words within an array. We can reopen the String class and write our own method in. | |
```Ruby | |
Class String | |
def split_words | |
split(' ') | |
end | |
end | |
``` |
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
# Floyd-Warshall Algorithm | |
## Introduction: | |
Finds Shortest Path (or longest path) among all pairs of nodes in a graph. | |
Complexity: O(|n|³) | |
## How does it work? | |
- There can be more than one route between two nodes. | |
- The number of nodes in the route isn’t important (Path 4 has 4 nodes but is shorter than Path 2, which has 3 nodes) | |
- There can be more than one path of minimal length |
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
# Api Versionioning | |
Ok, so we want to version our app. But which one is the best? This led me down the rabbit hole and into the depths of the darkest parts of the internet. | |
Here: http://stackoverflow.com/questions/389169/best-practices-for-api-versioning | |
the admins of stackoverflow closed this very question since as they put it | |
``` | |
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. | |
``` | |
Once I saw this I was better able to grasp the idea of versioning your API. I found this blog post by Troy Hunt who describes the three wrong ways to version your API and points out that you must merely choose the one that makes the most since to you and fits your app the best. So, going from here lets talk a bit about API Versioning. |