Skip to content

Instantly share code, notes, and snippets.

View ryanellis's full-sized avatar

Ryan Ellis ryanellis

View GitHub Profile
@ryanellis
ryanellis / debug.php
Last active July 18, 2023 13:46
Old-school PHP debugger
<?php
/**
* Print out argument to log file - note, arrays, objects are printed via var_dump()
* Useful for debugging an application where the logging implementation isn't great
*/
function d($msg) {
$bt = debug_backtrace();
$caller_bt = $bt[0];
$filename = basename($caller_bt['file']);
#!/bin/sh
# filename: dockerhostsync.sh
# example usage: sudo ./dockerhostsync.sh /etc/hosts
processfile=$1
tmpfile=${1}.tmp
backupfile=${1}.$(date "+%Y%m%d-%H%M%S").bak
# make a back-up
<?php
use Symfony\Component\HttpFoundation\Response;
/* INSIDE THE CONTROLLER */
// the varaibles you want to dump out
$var1 = 'bar_1;
$var2 = 'bar_2;
// create the twig template

Keybase proof

I hereby claim:

  • I am ryanellis on github.
  • I am ryanellis (https://keybase.io/ryanellis) on keybase.
  • I have a public key whose fingerprint is 7A0E 9F45 FEDD FBCD C6BA 5A81 982F 6F9E F5F2 BCCC

To claim this, I am signing this object: