Skip to content

Week 5 - Alexander Belozerov (sashabelozerov) #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ package-lock.json
.idea/

#sitemap
/public/sitemap.xml.gz
/public/sitemap.xml.gz

sitespeed-result/
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end
gem "actionpack-action_caching", "~> 1.2"
gem "active_record_union", "~> 1.3"
gem "acts-as-taggable-on", "~> 5.0"
gem "acts_as_follower", github: "thepracticaldev/acts_as_follower", branch: "master"
gem "acts_as_follower", github: "tcocca/acts_as_follower", branch: "master"
gem "addressable", "~> 2.5", ">= 2.5.2"
gem "administrate", "~> 0.11"
gem "ahoy_email", "~> 0.5"
Expand Down Expand Up @@ -122,7 +122,7 @@ group :development, :test do
gem "derailed", "~> 0.1"
gem "erb_lint", "~> 0.0", require: false
gem "faker", git: "https://github.com/stympy/faker.git", branch: "master"
gem "fix-db-schema-conflicts", github: "thepracticaldev/fix-db-schema-conflicts", branch: "master"
gem "fix-db-schema-conflicts"
gem "memory_profiler", "~> 0.9"
gem "parallel_tests", "~> 2.27"
gem "pry-byebug", "~> 3.7"
Expand Down
16 changes: 5 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,13 @@ GIT
i18n (>= 0.7)

GIT
remote: https://github.com/thepracticaldev/acts_as_follower.git
revision: 288690cd99bc470eaee493fce5bfa9fe23157692
remote: https://github.com/tcocca/acts_as_follower.git
revision: c5ac7b9601c4af01eb4d9112330b27be4d694ecc
branch: master
specs:
acts_as_follower (0.2.1)
activerecord (>= 4.0)

GIT
remote: https://github.com/thepracticaldev/fix-db-schema-conflicts.git
revision: 4172392392e1a8d907f7ab673cb5ddd9a4a31940
branch: master
specs:
fix-db-schema-conflicts (3.0.2)
rubocop (>= 0.38.0)

GEM
remote: https://rubygems.org/
remote: https://rails-assets.org/
Expand Down Expand Up @@ -322,6 +314,8 @@ GEM
thor (~> 0.14)
fission (0.5.0)
CFPropertyList (~> 2.2)
fix-db-schema-conflicts (3.1.0)
rubocop (>= 0.38.0)
fog (1.41.0)
fog-aliyun (>= 0.1.0)
fog-atmos
Expand Down Expand Up @@ -992,7 +986,7 @@ DEPENDENCIES
fastly-rails (~> 0.8)
feedjira (~> 2.2)
figaro (~> 1.1)
fix-db-schema-conflicts!
fix-db-schema-conflicts
fog (~> 1.41)
front_matter_parser (~> 0.2)
gemoji (~> 3.0.0)
Expand Down
9 changes: 9 additions & 0 deletions app/controllers/stories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ class StoriesController < ApplicationController
before_action :set_cache_control_headers, only: %i[index search show]

def index
push_headers = [
"<#{view_context.asset_path('bell.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('menu.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('connect.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('stack.svg')}>; rel=preload; as=image",
"<#{view_context.asset_path('lightning.svg')}>; rel=preload; as=image",
]
response.headers["Link"] = push_headers.join(", ")

add_param_context(:username, :tag)
return handle_user_or_organization_or_podcast_index if params[:username]
return handle_tag_index if params[:tag]
Expand Down
6 changes: 3 additions & 3 deletions app/views/layouts/_top_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
</div>
<a href="/new" id="write-link" class="cta nav-link write">WRITE A POST</a>
<a href="/connect" id="connect-link" class="nav-link connect-icon" aria-label="Connect">
<%= inline_svg("connect.svg", size: "100% * 100%") %>
<%= image_tag("connect.svg", size: "100% * 100%") %>
<div class="connect-number" id="connect-number"></div>
</a>
<a href="/notifications" id="notifications-link" class="nav-link notifications-icon" aria-label="Notifications">
<%= inline_svg("bell.svg", size: "100% * 100%") %>
<%= image_tag("bell.svg", size: "100% * 100%") %>
<div class="notifications-number" id="notifications-number"></div>
</a>
<div class="navbar-menu-wrapper" id="navbar-menu-wrapper">
<button class="navigation-butt" id="navigation-butt" aria-label="Navigation">
<% if user_signed_in? %>
<div class="nav-profile-image-wrapper"><img alt="" class="nav-profile-image" id="nav-profile-image" /></div>
<% else %>
<%= inline_svg("menu.svg", class: "bars", size: "20% * 20%") %>
<%= image_tag("menu.svg", class: "bars", size: "20% * 20%") %>
<% end %>
</button>
<div class="menubg" id="menubg"></div>
Expand Down
20 changes: 20 additions & 0 deletions nginx.conf.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server {
listen 443 http2 ssl;
server_name localhost;

ssl_certificate /etc/ssl/certs/localhost+1.pem;
ssl_certificate_key /etc/ssl/certs/localhost+1-key.pem;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:DES-CBC3-SHA:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!EXP:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_prefer_server_ciphers on;

location / {
http2_push_preload on;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_pass http://127.0.0.1:3000;
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
"prop-types": "^15.7.2",
"pusher-js": "^4.4.0",
"twilio-video": "^1.15.2",
"web-share-wrapper": "^0.2.1"
"web-share-wrapper": "^0.2.1",
"node-sass": "^4.14"
},
"jest": {
"setupFiles": [
Expand Down
1 change: 1 addition & 0 deletions sitespeed_after.har

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions sitespeed_before.har

Large diffs are not rendered by default.

Loading