View TestConstructorCallsMethod
public function testConstructorCallsMethod()
{
$callMethod = 'init'
$mock = $this
->getMockBuilder(ClassToTest::class)
->disableOriginalConstructor()
->getMock();
$mock
->expects($this->once())
View Makefile
.PHONY: help
# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
TARGET_MAX_CHAR_NUM=20
View .gitconfig
[user]
name = {user.fullname}
email = {user.email}
[commit]
template = /Users/{user.login}/.stCommitMsg
[alias]
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
filelog = log -u
fl = log -u
View .hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
View git-find-parent-branch.sh
git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
View main.go
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Println(r.URL)
View readme.md

Install composer

  1. sudo nano /usr/local/bin/composer
  2. Add
    #!/bin/sh
    export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
    echo "Current working directory: '"$(pwd)"'"
    docker run --rm -v $(pwd):/app -v ~/.ssh:/root/.ssh composer/composer $@
    
  3. chmod +x /usr/local/bin/composer
View common.sh
#!/bin/bash
# text colours
text_error='\033[0;31m'
text_success='\033[0;32m'
text_warning='\033[0;33m'
text_info='\033[0;34m'
text_default='\033[0m'
function e() {
View htmlentities.js
function htmlEntities(value)
{
return value.
replace(/&/g, '&').
replace(/</g, '&lt;').
replace(/>/g, '&gt;').
replace(/"/g, '&quot;');
}
View NullIfEmptyTrait.php
<?php
/**
* @author Ben Rowe <ben.rowe.83@gmail.com>
*/
namespace App\Models;
/**
* Defines a list of model attributes that need to be handled as null fields