Skip to content

Instantly share code, notes, and snippets.

View carltondickson's full-sized avatar
🏠
Working from home

Carlton carltondickson

🏠
Working from home
  • Carlton Dickson Development Ltd.
  • London
View GitHub Profile
@carltondickson
carltondickson / gist:2c6d2974780c0438ec8d
Created February 22, 2016 10:16
GIT - Reset to a previous commit
# Local reset:
git reset --hard fj5789sufj
# Remote reset:
git push -f origin fj5789sufj:master
@carltondickson
carltondickson / gist:6f2560b1d14ef00084b1
Last active February 4, 2016 17:20
Some basic GIT commands
# Checkout a tag
git checkout tags/0.0.3
# Checkout a branch
git checkout 0.0.3
@carltondickson
carltondickson / gist:52d0d1c5da8067f2e6ad
Created January 14, 2016 22:58
XDebug with rlerdorf/php7dev
# Use http://xdebug.org/wizard.php to generate similar instructions to below for your setup based on your phpinfo() output
cd /tmp
wget http://xdebug.org/files/xdebug-2.4.0rc3.tgz
tar -xvzf xdebug-2.4.0rc3.tgz
cd xdebug-2.4.0RC3
phpize
./configure
make
sudo cp modules/xdebug.so /usr/local/php70/lib/php/extensions/no-debug-non-zts-20151012
sudo nano /etc/php7/php.ini
@carltondickson
carltondickson / gist:3d3c978faba5becf838b
Created December 30, 2015 09:52
Virtual box mount on boot
# Ubuntu 14
sudo nano /etc/rc.local
mount -t vboxsf share_name_in_virtual_box /var/www/project
@carltondickson
carltondickson / gist:38f8e7d9fca8484d9c5e
Created December 7, 2015 09:41
Git aliases for GIT bash on Windows
cd ~
touch ./.bash_profile
# Add the following content to ~/.bash_profile
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
# Add some aliases to ~/.bashrc, e.g.
alias gfgp='git fetch --all && git pull'
@carltondickson
carltondickson / gist:1191192e77790d5217fb
Created November 30, 2015 11:23
Enable Xdebug on demand for Codeception
# Trigger xdebug on demand when running codeception
php -dxdebug.remote_autostart=1 ./vendor/codeception/codeception/codecept
# Example
php -dxdebug.remote_autostart=1 ./vendor/codeception/codeception/codecept run acceptance
@carltondickson
carltondickson / datatable.1.10.notes.md
Last active March 14, 2017 11:51
DataTables 1.10 notes
Table loaded callback
$('#example').dataTable( {
    "initComplete": function( settings, json ) {
        console.log( "Finished loading" );
    }
} );
@carltondickson
carltondickson / gist:d5b87aca542c3ad793e3
Created September 18, 2015 11:43
Toggle stylesheet visibility
var stylesheetIndex = 0;
var action = document.styleSheets[stylesheetIndex].disabled === false ? "Disabled " : "Enabled ";
document.styleSheets[stylesheetIndex].disabled = !document.styleSheets[stylesheetIndex].disabled;
console.log( action + "stylesheet:" + document.styleSheets[stylesheetIndex].href );
@carltondickson
carltondickson / gist:b57d0ad40c3230d52c81
Last active September 30, 2015 08:35
MySQL stored procedure skeleton
##################
# BASIC SKELETON #
##################
DELIMITER $$
USE `database-name`$$
DROP PROCEDURE IF EXISTS `database-name`.`procName` $$
CREATE PROCEDURE `database-name`.`procName` (IN varName1 VARCHAR(30), IN varName2 VARCHAR(30), IN varName3 INT)
@carltondickson
carltondickson / gist:b5421a81b0dc0b253c5d
Last active August 29, 2015 14:24
Sort git branches by date
# Remote branches
for k in `git branch -r|awk '{print $1}'`;do echo `git show --pretty=format:"%Cgreen%ci %Cblue%cr %Cred%cn %Creset" $k|head -n 1`\\t$k;done|sort -r