We need to generate secret key for development environment.
mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hfLet's generate User model and controller.
| Adding Bootstrap to Rails 7 | |
| Reference: https://www.linkedin.com/pulse/rails-7-bootstrap-52-importmap-md-habibur-rahman-habib/ | |
| INSTRUCTIONS | |
| 1. Add the following to Gemfile: | |
| gem "bootstrap" | |
| gem "sassc-rails" |
####david.antaramian in @elixir-lang slack, #beginners [2:11 PM]
Just in case you need it for reference in the future, this is the problem we normally see people run into: People will sometimes have called the environment variable during a module attribute assignment. Like the following:
defmodule MyAPP.APIClient do
@api_key System.get_env("API_KEY")
end| defmodule Map.Helpers do | |
| @moduledoc """ | |
| Functions to transform maps | |
| """ | |
| @doc """ | |
| Convert map string camelCase keys to underscore_keys | |
| """ | |
| def underscore_keys(nil), do: nil |
| defmodule Randomizer do | |
| @moduledoc """ | |
| Random string generator module. | |
| """ | |
| @doc """ | |
| Generate random string based on the given legth. It is also possible to generate certain type of randomise string using the options below: | |
| * :all - generate alphanumeric random string | |
| * :alpha - generate nom-numeric random string |
2008.csv file is too large so it is not in my git repository. If you want to run the scripts then you may have to download the file from http://stat-computing.org/dataexpo/2009/the-data.html.
For this final project I will use 2008 flights data that I downloaded from http://stat-computing.org/dataexpo/2009/the-data.html. The file doesn't have the geographic coordination of each airport so I downloaded the file that contains the information of coordinates of each airport from https://gist.githubusercontent.com/tdreyno/4278655/raw/7b0762c09b519f40397e4c3e100b097d861f5588/airports.json.
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| # Ask for the user password | |
| # Script only works if sudo caches the password for a few minutes | |
| sudo true | |
| # Install kernel extra's to enable docker aufs support | |
| # sudo apt-get -y install linux-image-extra-$(uname -r) | |
| # Add Docker PPA and install latest version | |
| # sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
| # sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
git checkout -b T1234-boo-foogit commit -am 'first'git commit -am 'now it works'arc lintarc diff