Using GitLab Pages to host composer repositories
./vendor/bin/satis build ./satis.json ./public
We start by creating a composer project.
$ composer init
Then we require satis, a composer library that creates static files to represent a composer repository.
Using git repositories as composer libraries
Composer allows you to use git repositories as composer libraries. Just add your a reference to your git repository in the repositories section of your composer.json file:
"repositories": [
{
"type": "vcs",
"url": "https://gitlab.com/bmosher/testpkg"
}
],
Then require your library:
$ composer require bmosher/testpkg
This will result in your library being available:
Installing Oracle's Java in Ubuntu
Create a root level opt directory.
$ sudo mkdir /opt
Download the JRE or JDK from Oracle as a tar file and uncompress it into /opt
$ cd /opt
$ sudo tar xvfz jdk-8u191-linux-x64.tar.gz
Create link to it, making it easier to replace this version of Java when it needs to be updated.
Git Aliases
Adding an alias to your git config to display a graphical branch view is as easy as issuing the following command:
$ git config --global alias.cglog log --graph \
--pretty=format:%Cgreen%h%x09%Cblue%aN%x09%Cred%ad%x09%Creset%s --date=short
You could also manually add the following to your .gitconfig in the [alias] section:
[alias]
cglog = log --graph --pretty=format:%Cgreen%h%x09%Cblue%aN%x09%Cred%ad%x09%Creset%s --date=short
Displays as:
Testing Email in Drupal with Behat
Adding the following to a FeatureContext.php will provide basic functionality to test for an email message sent to the current user and check for a partial subject match. It changes the existing mail system to one that stores mail in Drupal's state allowing us to iterate through the messages sent without having to implement an email client.
Git auto-completion in bash
This was another one of those tips that I wish I had found long, long ago. It gets tiring typing branch names over and over again, but thanks to git's bash auto-completion script I no longer have to.
The bash completion script is stored at /etc/bash_completion.d in Ubuntu, other distributions might store it in a different location. Add the following lines to your ~/.bashrc file:
Teaching git to (rerere)resolve Merge Conflicts
Reuse Recorded Resolution
If only I knew about this sooner. After repeatedly resolving the same merge conflicts over and over while merging in long-lived feature branches, I found rerere. Rerere saves your merge resolutions and automatically reapplies them the next time you encounter the same conflicts. Once enabled it works behind the scenes without you needing to change the way you work.
To enable:
$ git config --global rerere.enabled true
Then merge in feature branch:
.vimrc
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set expandtab
if has ("autocmd")
augroup module
autocmd BufRead,BufNewFile *.module set filetype=php
autocmd BufRead,BufNewFile *.install set filetype=php
autocmd BufRead,BufNewFile *.test set filetype=php
autocmd BufRead,BufNewFile *.inv set filetype=php
autocmd BufRead,BufNewFile *.profile set filetype=php
autocmd BufRead,BufNewFile *.view set filetype=php
augroup END
endif
s