RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
This file contains hidden or 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
| FROM alpine:3.4 | |
| ##################### Base dependencies ################################# | |
| RUN apk --no-cache add ruby ruby-irb ruby-json git ruby-bigdecimal ruby-rake \ | |
| ruby-io-console ruby-bundler libstdc++ tzdata postgresql-client nodejs \ | |
| libxml2 libxslt libgcrypt sqlite-libs pcre curl postgresql bash procps openssh \ | |
| && cp /usr/bin/pg_dump /usr/bin/pg_restore /tmp/ \ | |
| && apk del --purge postgresql \ | |
| && mv /tmp/pg_dump /tmp/pg_restore /usr/bin/ \ | |
| && echo "gem: --no-document" > /etc/gemrc |
This file contains hidden or 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
| FROM alpine:3.4 | |
| ##################### Base dependencies ################################# | |
| RUN apk --no-cache add ruby ruby-irb ruby-json git ruby-bigdecimal ruby-rake \ | |
| ruby-io-console ruby-bundler libstdc++ tzdata postgresql-client nodejs \ | |
| libxml2 libxslt libgcrypt sqlite-libs pcre curl postgresql bash procps openssh \ | |
| && cp /usr/bin/pg_dump /usr/bin/pg_restore /tmp/ \ | |
| && apk del --purge postgresql \ | |
| && mv /tmp/pg_dump /tmp/pg_restore /usr/bin/ \ | |
| && echo "gem: --no-document" > /etc/gemrc |
This file contains hidden or 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
| FROM ruby:2.3.1 | |
| # Install dependencies | |
| RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
| # Set an environment variable where the Rails app is installed to inside of Docker image: | |
| ENV RAILS_ROOT /var/www/app_name | |
| RUN mkdir -p $RAILS_ROOT | |
| # Set working directory, where the commands will be ran: |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
This file contains hidden or 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
| # nil? can be used on any Ruby object. It returns true only if the object is nil. | |
| nil.nil? # => true | |
| [].nil? # => false | |
| {}.nil? # => false | |
| "".nil? # => false | |
| " ".nil? # => false | |
| true.nil? # => false | |
| # empty? can be used on some Ruby objects including Arrays, Hashes and Strings. It returns true only if the object's length is zero. | |
| nil.empty? # NoMethodError: undefined method `empty?' for nil:NilClass |
Translations: Korean (by Yongwoo Lee)
Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.
I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).
This file contains hidden or 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
| #!/bin/bash | |
| # Install dependencies | |
| # older ubuntus | |
| #apt-get install build-essential libsqlite3-dev ruby1.9.1-dev | |
| # xenial | |
| apt install build-essential libsqlite3-dev ruby-dev | |
| # Install the gem | |
| gem install mailcatcher --no-ri --no-rdoc |
This file contains hidden or 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
| ## How to install mcrypt in php7.2 | |
| ## | |
| ## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/ | |
| ## | |
| # | |
| # Check version php and pecl | |
| # | |
| php -v # if default php is not 7.2 then use /usr/bin/php7.2 instead php |
This file contains hidden or 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
| # check if there is a file named maintenance.html | |
| # so when you want to disable maintenance mode just remname "mv maintenance.html maintenance.html.disabled" | |
| RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f | |
| RewriteCond %{SCRIPT_FILENAME} !maintenance.html | |
| RewriteRule ^.*$ /maintenance.html [R=503,L] | |
| ErrorDocument 503 /maintenance.html |