All code is available in example app - https://github.com/maxivak/webpacker-rails-example-app
| sudo apt-get install netcat openssl libpcre3 dnsmasq procps perl | |
| # for ubuntu 16.04 (xenial) | |
| sudo apt-get -y install postgresql postgresql-contrib phppgadmin | |
| sudo -i -u postgres | |
| psql | |
| CREATE USER kong; CREATE DATABASE kong OWNER kong; | |
| ALTER USER kong WITH password 'kong'; |
| # An example global gitignore file | |
| # | |
| # Place a copy if this at ~/.gitignore_global | |
| # Run `git config --global core.excludesfile ~/.gitignore_global` | |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll |
| <?php | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Follow this instructions: | |
| |-------------------------------------------------------------------------- | |
| | | |
| | Laravel takes a dead simple approach to your application environments | |
| | so you can just specify a machine name for the host that matches a | |
| | given environment, then we will automatically detect it for you. |
| class SetDatabaseDefaults < ActiveRecord::Migration | |
| def up | |
| case ActiveRecord::Base.connection.adapter_name | |
| when "MySQL", "Mysql2" | |
| execute "ALTER DATABASE #{current_database} DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci" | |
| when "SQLite" | |
| # do nothing since SQLite does not support changing the database encoding and only supports unicode charsets | |
| when "PostgreSQL" | |
| # do nothing since PostgreSQL does not support changing the database encoding |
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| class LinkHeaderPagination | |
| { | |
| /** | |
| * @param $request |
When setting up CI servers, it can sometimes be necessary to have different versions of Composer dependencies installed globally.
For example, when your CI server mainly deals with CakePHP 2.x and 3.x applications, where the coding standards vary.
This guide aims to walk you through how one might acheive this.
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Contracts\Auth\Factory as Auth; | |
| class Authenticate | |
| { | |
| /** |
Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.