The workflow we will follow looks like this:
- Planning
- Initializing Application
- Building the Rails Model
- Configure our Dev Environment
- Defining Routes
- Writing Controllers and their Views (iterate)
- Styling Views
- Share!
The workflow we will follow looks like this:
# The first term is the speed of light in meters per second | |
# (this is actually exact - a meter is defined as | |
# "the length of the path travelled by light in vacuum during a time interval of 1/299 792 458 of a second.". | |
# The second term, 100 is the number of centimeters in a meter. | |
# The third term, 1.0/1000000000 is one billionth. (Note that we need the .0 here (or at least 1.) | |
# to make Ruby do floating point division. Otherwise, 1/1000000000 would evaluate to 0.) | |
# So, the first three terms in the product compute the distance in centimeters |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
body { | |
margin: 0; | |
background: #222; | |
min-width: 960px; | |
} |
eval "$(rbenv init -)" | |
# ================= | |
# Bash Prompt | |
# ================= | |
# -------------------- | |
# Colors for the prompt | |
# -------------------- | |
RED="\[\033[0;31m\]" |
PATH=$PATH:$HOME/.rvm/bin |
Ensure the correct permissions are set by running the following in Terminal: | |
sudo chown -R $USER /usr/local |
In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.
Inheritance | |
Inheritance allows a class of objects to inherit the properties of another class. | |
Lets say for example we want to have a Parent and Child classes. We want the Child class to inherit from Parent. | |
function Parent() {}; | |
Parent.prototype.name = 'Parent'; |
## | |
# Creates an alias called "git hist" that outputs a nicely formatted git log. | |
# Usage is just like "git log" | |
# Examples: | |
# git hist | |
# git hist -5 | |
# git hist <branch_name> | |
# git hist <tag_name> -10 | |
## | |
git config --global alias.hist "log --pretty=format:'%C(yellow)[%ad]%C(reset) %C(green)[%h]%C(reset) | %C(red)%s %C(bold red){{%an}}%C(reset) %C(blue)%d%C(reset)' --graph --date=short" |
for (var i = 1; i <=5; i++){ | |
setTimeout(function(){ | |
console.log("vaule of i is: " + i); | |
},i*1000); | |
} | |
for (var i = 1; i <=5; i++){ | |
(function(i){ | |
setTimeout(function(){ |