sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator
Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").
FROM ruby:2.3.1 | |
# Install dependencies | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
# Set an environment variable where the Rails app is installed to inside of Docker image: | |
ENV RAILS_ROOT /var/www/app_name | |
RUN mkdir -p $RAILS_ROOT | |
# Set working directory, where the commands will be ran: |
- Check rails version | |
$ rails -v | |
- To update rails | |
$ gem update rails | |
- Creating a new rails app using postgresql | |
$ mkdir rails_projects | |
$ cd rails_projects | |
$ rails new myapp --database=postgresql |
## 1) What is SQL Injection | |
QL Injection is a security vulnerability where an attacker can run arbitrary SQL code on your machine because we are not using safe Active Record practices. | |
## 2) Which of these are safe from SQL Injection attacks? | |
A) safe | |
User.where(:name => params[:name]) |
## 1) Instance or class method? | |
A) User.where(:name => 'rich') | |
- class method | |
## Week 5 Quiz | |
## 0) Name 3 types of variables in Ruby? Put them in order from least scope to greatest. | |
1. Local variable(new = "foo") | |
2. Instan variable(@new="foo") | |
3.Constant(NEW="foo") | |
## 1) Where do SQL queries belong, the view or controller? |
## 1) What does MVCr stand for? | |
Model View Control Router | |
## 2) In what file do we store 'r' from MVCr ? | |
mysql, rmagic, curl, git, vim, sqlite, nodejs nokogiri...
sudo apt-get install libxslt1-dev libxml2-dev build-essential patch libsqlite3-dev libcurl4-openssl-dev curl git git-gui vim-gtk exuberant-ctags nodejs nodejs-legacy rar
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update