sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot
# This is example contains the bare mininum to get nginx going with | |
# Unicorn or Rainbows! servers. Generally these configuration settings | |
# are applicable to other HTTP application servers (and not just Ruby | |
# ones), so if you have one working well for proxying another app | |
# server, feel free to continue using it. | |
# | |
# The only setting we feel strongly about is the fail_timeout=0 | |
# directive in the "upstream" block. max_fails=0 also has the same | |
# effect as fail_timeout=0 for current versions of nginx and may be | |
# used in its place. |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message: | |
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)" | |
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this: | |
# Do not keep production secrets in the repository, | |
# instead read values from the environment. | |
production: | |
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> |
# Provides feature related to page tagging | |
# | |
module TagPages | |
# finds out every item containing tags | |
# @return Array an array of Nanoc::Item | |
def tagged_items | |
@items.select do |item| | |
item[:tags].is_a? Array | |
end | |
end |
class Middleman::Extensions::DirManager < Middleman::Extension | |
register :dir_manager | |
option :dirs, {source: 'pages', destination: '', add: [], remove: ['', 'pages']} | |
def manipulate_resource_list resources | |
[options.dirs].flatten.each do |opts| | |
# Remove pages if specified | |
opts[:remove].each do |dir| | |
resources.reject! do |page| | |
Dir.glob(normalise(dir) + '/*', File::FNM_DOTMATCH).include? page.source_file |
From my Pluralsight course: https://app.pluralsight.com/library/courses/asynchronous-javascript-reasoning/table-of-contents
export const schema = { | |
"type": "object", | |
"properties": { | |
"users": { | |
"type": "array", | |
"minItems": 3, | |
"maxItems": 5, | |
"items": { | |
"type": "object", | |
"properties": { |
{ | |
"root": true, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:import/errors", | |
"plugin:import/warnings" | |
], | |
"parserOptions": { | |
"ecmaVersion": 7, | |
"sourceType": "module" |