Skip to content

Instantly share code, notes, and snippets.

@breenie
breenie / remote-enable-xdebug
Last active December 18, 2015 00:49
Enable xdebug from the browser, terminal, whatever. Never forget the stupid param again!
XDEBUG_SESSION_START=XDEBUG_ECLIPSE
@breenie
breenie / .emacs
Last active December 18, 2015 08:29
Sensible .emacs defaults.
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
@breenie
breenie / gist:5755114
Last active December 18, 2015 08:38 — forked from makasim/gist:3720535
Forked for my reference, thanks makasim!
<?php
namespace Foo;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
/**
* Changes Form->bind() behavior so that it treats not set values as if they
* were sent unchanged.
@breenie
breenie / compact-sparsebundle
Created June 19, 2013 08:56
How to reclaim space from a sparse bundle
hdiutil compact bundle.sparsebundle
$ ssh-keygen -t dsa
$ scp ~/.ssh/id_dsa.pub <host name>:.ssh/authorized_keys2
# This only needs to be called once to add the key.
$ ssh-agent sh -c 'ssh-add < /dev/null && bash'
@breenie
breenie / gist:5934075
Last active December 19, 2015 09:38
Listen to tcp ports on OSX (this example is for port 8080)
sudo tcpdump -A -s0 -ien1 port 8080
<?php strtolower(preg_replace('/(?<=[a-z])([A-Z])/', '_$1', $string)); ?>
@breenie
breenie / debug-console-app
Created August 1, 2013 12:53
Enables debugging from your php console apps, that is all.
export XDEBUG_CONFIG="idekey=XDEBUG_ECLIPSE"
SELECT c.table_schema,u.table_name,u.column_name,u.referenced_table_name,u.referenced_column_name
FROM information_schema.table_constraints AS c
INNER JOIN information_schema.key_column_usage AS u
USING( constraint_schema, constraint_name )
WHERE c.constraint_type = 'FOREIGN KEY'
AND u.referenced_table_schema='<database>'
AND u.referenced_table_name = '<table>'
ORDER BY c.table_schema,u.table_name;
scp ~/.ssh/id_rsa.pub <username>@<server>:.ssh/authorized_keys