Skip to content

Instantly share code, notes, and snippets.

View trq's full-sized avatar

Tony R Quilkey trq

  • thorpesystems
  • Sydney, Australia
View GitHub Profile
@patricknelson
patricknelson / - Using Xdebug in Docker.md
Last active October 15, 2023 19:59
Using Xdebug in Docker (works with PhpStorm)

Using Xdebug in Docker

Getting setup and running with Xdebug in a docker container these days is now fairly simple and is composed of two main steps:

  1. Ensure you've got XDebug installed and enabled in your PHP docker image, for example:
    # Installing Xdebug with PHP 7.3 images:
    RUN pecl install xdebug \
      && docker-php-ext-enable xdebug
@cdelaitre
cdelaitre / docker-compose-tick.yml
Last active March 22, 2021 20:01
Monitor Docker Swarm with the InfluxData TICK Stack
version: '3'
services:
# FRONT
chronograf:
# Full tag list: https://hub.docker.com/r/library/chronograf/tags/
image: chronograf
deploy:
replicas: 1
placement:
constraints:
@tortuetorche
tortuetorche / FiniteAuditTrailTrait.php
Created July 12, 2016 15:32
FiniteStateMachine and FiniteAuditTrail Traits for Laravel 5.1 (WIP)
<?php namespace App\Finite;
/**
* The FiniteAuditTrail Trait.
* This plugin, for the Finite package (see https://github.com/yohang/Finite), adds support for keeping an audit trail for any state machine.
* Having an audit trail gives you a complete history of the state changes in your stateful model.
* Prerequisites:
* 1. Install Finite package (https://github.com/yohang/Finite#readme)
* 2. Use FiniteStateMachine in your model (https://gist.github.com/tortuetorche/6365575)
* Usage: in your Stateful Class use this trait after FiniteStateMachine trait, like this "use FiniteAuditTrailTrait;".
#!/bin/bash
current=$PWD
cd $HOME
sudo brew install zsh
chsh -s /bin/zsh $USER
brew tap thoughtbot/formulae
#!/bin/bash
current=$PWD
cd $HOME
sudo apt-get install zsh
chsh -s /bin/zsh $USER
wget https://thoughtbot.github.io/rcm/debs/rcm_1.3.0-1_all.deb
@ericelliott
ericelliott / gitclean.sh
Created January 31, 2016 04:57
gitclean.sh - cleans merged/stale branches from origin
git remote prune origin
git branch -r --merged master | egrep -iv '(master|develop)' | sed 's/origin\///g' | xargs -n 1 git push --delete origin
@leedm777
leedm777 / docker-run-ssh.sh
Created August 12, 2015 15:29
Run docker, forwarding your SSH agent into the container
#!/bin/sh
#
# Forwards SSH agent into a Docker container running in the active
# docker-machine
#
PROGNAME=$(basename $0)
NAME=$(docker-machine active)
@sampart
sampart / pre-commit-csfixer
Created May 18, 2015 14:27
git pre-commit hook to run the Coding Standards fixer against changed files
#!/bin/bash
# Coding Standards fixer from http://cs.sensiolabs.org/ pre-commit hook for git
#
# Based on https://github.com/s0enke/git-hooks
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
#
# see the README
@frankdejonge
frankdejonge / example.php
Created April 26, 2015 09:30
Streamed upload
<?php
$source = $_FILES['name']['tmp_name'];
$handle = fopen($source, 'r+');
$filesystem->writeStream('destination/file.txt', $handle);
if (is_resource($handle)) {
fclose($handle);
}
@fideloper
fideloper / CodeTest.php
Created November 11, 2013 13:55
Example testing with in-memory SQLite database
<?php
/**
* Intention:
*
* "testing" environment has a SQLite database configured
* Run migrations against --env=testing
*
* Separate seeds run here per test method will delete the SQLite
* code tables, and re-create them with codes that fit the needs