This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zend_extension=xdebug.so | |
xdebug.remote_host=127.0.0.1 | |
xdebug.remote_enable=1 | |
xdebug.remote_port=9000 | |
xdebug.remote_handler=dbgp | |
xdebug.remote_mode=req | |
xdebug.idekey=netbeans-xdebug | |
xdebug.remote_autostart=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ModelA{ | |
public function sayHi() { return "hi"; } | |
} | |
class ModelB extends ModelA { | |
public function sayHi() { return "hello"; } | |
} | |
class SomethingA{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$value = "some\"string'™"; | |
?> | |
<form name="test" action="<?php echo time(); ?>" method="POST"> | |
<input type="text" value="<?php echo htmlentities($value, ENT_QUOTES, 'UTF-8'); ?>" name="test"> | |
<input type="submit" value="go" name="go" /> | |
</form> | |
<br/> | |
<br/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vhost disable asset cacheing | |
<Directory .../public_html> | |
#disable caching | |
Header unset ETag | |
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" | |
Header set Pragma "no-cache" | |
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" | |
</Directory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install \ | |
gparted \ | |
gedit \ | |
apache2 \ | |
libapache2-mpm-itk \ | |
php5 \ | |
php5-xdebug \ | |
php5-xsl \ | |
php5-mcrypt \ | |
php5-curl \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script makes Netbeans use a custom phpcs.xml (PHP Codesniffer) | |
# Note: git dir does not work (NB runs out of the git dir) | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
# When asked for the standards, return them | |
# note: The last file is our standard! | |
if [ $1 = '-i' ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//---TEST1---------------------------------------------------- | |
function objectTest(stdClass $input) { | |
$input->name = "Sally"; | |
} | |
$object = new stdClass; | |
$object->name = "Bob"; | |
$object->address = "1 Test Street"; | |
objectTest($object); | |
echo $object->name; //Sally |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Useful queries for database(s) with no documentation | |
--Note: Phpmyadmin, database() will not work and this needs to be a param | |
SET @inspect_table = 'change_me'; | |
SET @database = database(); | |
--SELECT ALL | |
SET @s = CONCAT('select * from ', @inspect_table); | |
PREPARE stmt1 FROM @s; | |
EXECUTE stmt1; | |
DEALLOCATE PREPARE stmt1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//This is not just about performance, but also readability! | |
//But if you can get a win win, why not! | |
//Please read https://nikic.github.io/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html | |
$varA = "Some really long string here dasdlasmd;mas;lemas;lem;lasmel;asme"; | |
$varB = "Some other string here"; | |
//Test 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---x------ 1 nobody nogroup 0 Sep 1 20:34 100 | |
--w------- 1 nobody nogroup 0 Sep 1 20:34 200 | |
--wx------ 1 nobody nogroup 0 Sep 1 20:34 300 | |
-r-------- 1 nobody nogroup 0 Sep 1 20:34 400 | |
-r-x------ 1 nobody nogroup 0 Sep 1 20:34 500 | |
-rw------- 1 nobody nogroup 0 Sep 1 20:34 600 | |
-rwx------ 1 nobody nogroup 0 Sep 1 20:34 700 | |
OlderNewer