Here's what I did to get things working.
Yep, over at: https://developer.apple.com
| # https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html | |
| # https://www.varnish-cache.org/trac/wiki/VCLExamples | |
| # Summary | |
| # 1. Varnish will poll the backend at /health_check to make sure it is | |
| # healthy. If the backend goes down, varnish will server stale content | |
| # from the cache for up to 1 hour. | |
| # 2. Varnish will pass X-Forwarded-For headers through to the backend | |
| # 3. Varnish will remove cookies from urls that match static content file | |
| # extensions (jpg, gif, ...) |
| # db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb | |
| class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
| def change | |
| add_column :users, :authentication_token, :string | |
| add_index :users, :authentication_token, :unique => true | |
| end | |
| end |
| gem 'foreman' | |
| gem 'puma' |
| # Assuming that you have followed all the instructions from https://github.com/rumblelabs/asset_sync | |
| # Put this in your deployment script | |
| # Choose any environment here the important part is that your environment is using the same bucket for all environments | |
| # than you only need to precompile assets once | |
| RAILS_ENV=staging bundle exec rake assets:precompile | |
| # You need to set git credentials otherwise it won't be able to commit | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Codeship Server" | |
| # Add your manifest file so that rails can find digested version of files |
| ##################################################################### | |
| # Simplified Facebook interactions/navigation via Ruby/Mechanize. # | |
| # Author: Robbie Harjes # | |
| # Date: 6/8/2011 # | |
| # Notes: Not liable for misuse; free for non-commercial projects.# | |
| # This notice must remain intact if you use this code. # | |
| ##################################################################### |
| WITH table_scans as ( | |
| SELECT relid, | |
| tables.idx_scan + tables.seq_scan as all_scans, | |
| ( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
| pg_relation_size(relid) as table_size | |
| FROM pg_stat_user_tables as tables | |
| ), | |
| all_writes as ( | |
| SELECT sum(writes) as total_writes | |
| FROM table_scans |
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
| # Fixing permissions of packaged gems | |
| files: | |
| "/opt/elasticbeanstalk/hooks/appdeploy/pre/10_fixing_permission.sh": | |
| content: | | |
| #!/usr/bin/env bash | |
| # . /opt/elasticbeanstalk/containerfiles/envvars | |
| . /opt/elasticbeanstalk/support/envvars | |
| CACHE_GEM_DIR=$EB_CONFIG_APP_ONDECK/vendor/cache |
This class makes it easier to generate a leaderboard that complies with the Standard Competition Ranking system. That is, it takes joint/tied positions into account, and adjusts the positions accordingly.
Take the following list of users and points for example:
User | Points
1 35
2 35
I have been struggling to start a new project with Phoenix 1.3 and the new vue-cli 3 for Vue.js. There are tons of example already but none of them suited my needs, because:
Assuming that you have Elixir and Phoenix 1.3 are both installed, let's build our new App.