Skip to content

Instantly share code, notes, and snippets.

Avatar

Geoffrey Hoffman phpguru

View GitHub Profile
@phpguru
phpguru / docker-compose.yml
Created Jun 22, 2020
Here is my docker-compose.yml for doing local development with Nginx, PHP-FPM, MySQL, Redis, ElasticSearch & Kibana
View docker-compose.yml
version: "3"
services:
db:
container_name: db
image: db:latest
environment:
- MYSQL_ROOT_PASSWORD=REDACTED
- APP=db
ports:
- "3306:3306"
@phpguru
phpguru / docker_shortcuts.sh
Last active Jun 22, 2020
Paste or link these into your ~/.bash_profile
View docker_shortcuts.sh
######################################################
# Docker Shortcuts
# Maintainer geoffrey.hoffman@gmail.com
######################################################
# Load these into your bash profile, e.g. add
# source ~/.docker_shortcuts.sh
# to ~/.bash_profile
echo "docker shortcuts loaded"
@phpguru
phpguru / salt-call-output.log
Created Nov 4, 2018
Output of salt-call state.show_highstate
View salt-call-output.log
root@saltmaster:/srv/salt# salt-call state.show_highstate
local:
----------
psmisc:
----------
pkg:
- installed
|_
----------
order:
@phpguru
phpguru / state-apply-terminal-output.log
Last active Nov 3, 2018
Strange output from state.apply test=True
View state-apply-terminal-output.log
root@saltmaster:/srv# salt 'api*' state.apply test=True
dev-server.on-my.network:
----------
ID: /etc/hosts
Function: file.comment
Result: None
Comment: File /etc/hosts is set to be updated
Started: 16:09:10.954681
Duration: 8.716 ms
Changes:
@phpguru
phpguru / duplicate_music_fixer.php
Last active Jul 6, 2018
PHP Script to find and delete duplicate mp3 files
View duplicate_music_fixer.php
<?php
/**
* This script will search in your iTunes Music folder for duplicate
* mp3 and aac files, and print them out for inspection.
*
* HOW TO USE:
* Do a dry run, inspect the output, and if desired, do a delete run.
*
* To do a dry run:
*
View gist:4670029
☹☺☻☃☠
⚠⚡✆♿
✈☎☏☂☔✉☄☽☾☕✇❤
☯✝✞✟☨☦☭☮☪☫☬☩✠☧✡
♈♉♊♋♌♍♎♏♐♑♒♓
♀♂☿♁⚢⚣⚤⚥⚦⚧⚨⚩
❁❀✿✽✾❃⚘☘
♚♔♛♕♜♖♝♗♞♘♟♙
♥♡♠♤♦♢♣♧
✩★☆✪✫✬✭✮✯✰☼☸☉❂
View static-non-static-mixing.php
<?php
class Foo {
public static function bar() {
echo "calling public static bar() in an ".(isset($this)?"object (".get_class($this).")":"static")." context. \n";
}
public function baum() {
echo "calling public baum in an ".(isset($this)?"object (".get_class($this).")":"static")." context. \n";
}
}
View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnSi0RUxRrhmB66fPkoHCPpK3pz953MsEIc/FNmmJhKpvK2IwgjwjXDsMWellY8jTVDmpbEio5PZWCtIFuFOlleAFM/wiocUsSNYMgR2QEeWKqSQ4q76hrkBoIKxThCnI0PRnSFmiXsK74dvEmsBfgEVbJSXd7Kwg1tHBl3FB4vHslCMm5g8e8abRD9wi4iRKxtdxO+jKtQ8JcZ256hrHsaLMz1fXTWlKXd0NoreOcQzO4umqfBxBBY5QIv/GVrbADQlpw3Ilwez/fiw52/dW7F2ndUqJx0O4KGy/bRtLp+f35YsdQzdwgnqMeOA4NnU/iAOixk/zehhcEZ/aYWqB9 geoffrey.hoffman@gmail.com
@phpguru
phpguru / r10ku.sh
Last active Aug 29, 2015
Force update a specific puppet environment using r10k with clearing cache
View r10ku.sh
#!/bin/bash
#
# Update a specific puppet environment, typically a git branch `featurename`
# or one of your deployment environments, typically `development` or `production`
#
# Save the script as r10ku somewhere in your $PATH and chmod +x it
#
# example usage:
#
# > sudo su -
View Date.php
<?php
/**
* Date class
*/
class Date {
/**
* Fuzzy date strings
*
* @var array