$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt install git-core zsh autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev -y
$ sudo apt-add-repository ppa:git-core/ppa && sudo apt-get update && sudo apt-get install git -y
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
$light_gray: #CCC; | |
body { | |
background-color: $light_gray; | |
font: { | |
family: Helvetica, Arial, sans-serif; | |
size: 14px; | |
} | |
} |
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> | |
<title>Blogger</title> | |
<%= stylesheet_link_tag "application", media: "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> | |
<p class="flash"> |
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
<body> | |
<p class="flash"> | |
<%= flash.notice %> | |
</p> | |
<div id="container"> | |
<div id="content"> | |
<%= yield %> | |
<hr> | |
<h6> | |
<% if logged_in? %> |
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
<h1>Login</h1> | |
<%= form_tag author_sessions_path, method: :post do %> | |
<div class="field"> | |
<%= label_tag :username %> | |
<%= text_field_tag :username %> | |
<br/> | |
</div> | |
<div class="field"> | |
<%= label_tag :password %> |
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
namespace :app do | |
desc "Ensures that the reset task only happens in development, | |
not the production environment" | |
task ensure_development_environment: :environment do | |
if Rails.env.production? | |
raise "Rake tasks aborted - you are running a production environment.\n | |
(You are requesting that the production database is dropped!)" | |
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
# Login as postgres user (superuser) | |
sudo -u postgres psql <db> | |
# Login to a db using a username | |
psql db_name -U username | |
# Create a new user and allow them to create databases | |
CREATE USER username WITH LOGIN; | |
ALTER ROLE username WITH CREATEDB; |