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 / cache.md
Created February 28, 2017 11:35
Laravel 5.2 cache notes

Cache file name

  • Just an md5 of the cache key
  • Therefore not possible to identify key name from file name - md5 is one way

Cache directory name

  • Level 1 - First 2 characters of filename
  • Level 2 - Next 2 characters of filename
# /usr/bin/xdebug
#!/bin/bash
XDEBUG_CONFIG="idekey=xdebug" php -dxdebug.remote_host=`echo $SSH_CLIENT | cut -d "=" -f 2 | awk '{print $1}'` "$@"
@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:a7f0f74f81fb82dd0ab9
Last active May 25, 2016 12:59
Ubuntu shortcuts - PHPSTORM SUBLIME
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_GB]=bash
Name[en_GB]=PhpStorm 9 - EAP
Exec=/bin/bash /home/carlton/programs/PhpStorm-141.1224/bin/phpstorm.sh
Name=PHPStorm
Icon=/home/carlton/programs/webide.png
@carltondickson
carltondickson / .bash_alias
Last active May 16, 2016 12:46
Bash aliases
# ALIASES
## APACHE
alias apache-restart='sudo service apache2 restart'
alias apache-reload='sudo service apache2 reload'
## PHP
alias cdd-command='/usr/bin/php /var/www/commands/app/app.php'
## GIT
@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
# Install Java 7 JDK and create an alias if needed
alias selenium_start='java -jar ./selenium-server-standalone-2.48.2.jar'
# Useful notes "codeception/codeception": "~2.0"
The AcceptanceTester parameter passed into the tests is a class that is generated dynamically, if web driver is used as a module then the web driver functions will be available in the auto complete
# Running tests in general
http://codeception.com/docs/02-GettingStarted#Running-Tests
# Running tests for specific environments
@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 / useful.sql
Last active February 3, 2016 09:51
MySQL useful queries
# Show running queries
SHOW FULL PROCESSLIST;
# Show who is connected
SHOW STATUS LIKE '%onn%';
# Search stored procedures for a string
SELECT * FROM information_schema.`ROUTINES` r WHERE r.`ROUTINE_DEFINITION` LIKE '%string%';