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 | |
error_reporting(E_ALL & ~E_NOTICE); | |
ini_set('display_errors', TRUE); | |
ini_set('display_startup_errors', TRUE); | |
for ($index = 0; $index < 10000; $index++) | |
{ | |
$insertdata[] = array('test'); | |
} |
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 | |
//Add commitment control to the DB2 Connect by using i5_commit | |
//Apparently you can't set this using ini_set. Therefore this would have to be set in the PHP.ini | |
//ini_set('ibm_db2.i5_allow_commit',1); | |
ini_set('ibm_db2.autocommit',DB2_AUTOCOMMIT_OFF); | |
$options = array('i5_lib' => 'MYLIB','autocommit' => DB2_AUTOCOMMIT_OFF,'i5_commit' => DB2_I5_TXN_SERIALIZABLE); | |
//Connect to DB2 - Commitments wont take place until we call | |
//db2_commit($db2Connection) on the connection. |
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 | |
$server = db2_server_info( $db2Connection ); | |
var_dump($server);exit(); | |
//DFT_ISOLATION and ISOLATION_OPTION should be looked at | |
?> |
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
;Bind to CTRL+S key | |
~^S:: | |
;If Netbeans is active (SunAwtFrame) is a class, you could change this to the actual title but you'll have to update the script more often | |
IfWinActive, ahk_class SunAwtFrame | |
{ | |
;Msbox for debugging purposes. ; is used to comment it out | |
;MsgBox NetBeans Active | |
;Activate Firefox |
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
<? | |
//CSP only works in modern browsers Chrome 25+, Firefox 23+, Safari 7+ | |
$headerCSP = "Content-Security-Policy:". | |
"connect-src 'self' ;". // XMLHttpRequest (AJAX request), WebSocket or EventSource. | |
"default-src 'self';". // Default policy for loading html elements | |
"frame-ancestors 'self' ;". //allow parent framing - this one blocks click jacking and ui redress | |
"frame-src 'none';". // vaid sources for frames | |
"media-src 'self' *.example.com;". // vaid sources for media (audio and video html tags src) | |
"object-src 'none'; ". // valid object embed and applet tags src | |
"report-uri https://example.com/violationReportForCSP.php;". //A URL that will get raw json data in post that lets you know what was violated and blocked |
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 | |
//Get the Page Id of the parent | |
if ($post->post_parent) | |
{ | |
//There's a parent post lets get the ancestors and grab the top | |
$ancestors = get_post_ancestors($post->ID); | |
$parentPostId = $ancestors[count($ancestors) - 1]; | |
} | |
else | |
{ |
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
SELECT a.*, b.NumberOfRows | |
FROM MYTABLE a | |
CROSS JOIN (SELECT COUNT(*) AS NumberOfRows FROM MYTABLE) b |
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 | |
if(unlink("test.txt")) | |
echo "true"; | |
else | |
echo "false"; |
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
SELECT * | |
FROM MYTABLE | |
WHERE TRANSLATE (MYTABLE.MYFIELD, 'NNNNNNNNNNX', '1234567890N') = 'NNNNN' AND MYTABLE.MYFIELD<10000 | |
--MYFIELD is a CHAR(5) field and is being compared against 5 'N's |