Skip to content

Instantly share code, notes, and snippets.

View gjerokrsteski's full-sized avatar
🎯
Focusing

Gjero Krsteski gjerokrsteski

🎯
Focusing
View GitHub Profile
@gjerokrsteski
gjerokrsteski / php-send-pdf-file-as-header
Created December 8, 2010 16:18
sends pdf-file as header through any firewall and browser
/**
* Prints out the new generated pdf-file as an raw HTTP-header.
* @link http://reeg.junetz.de/DSP/node16.html
* @link http://www.php.net/manual/de/function.header.php#88038
* @return void
*/
function sendPdfFileAsHeader($pdfFile, $fileName)
{
$disposition = (false !== strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5'))
? ''
<?php
apc_clear_cache();
apc_clear_cache('user');
apc_clear_cache('opcode');
echo 'success = true'.PHP_EOL;
@gjerokrsteski
gjerokrsteski / gist:9bdeb4af3874742ec944
Created March 11, 2015 16:09
is_null($x) vs $x === null in PHP
<?php
error_reporting(E_USER_NOTICE);
//checking with ===
$a = array();
$time = microtime(true);
for($i=0;$i<10000;$i++) {
if($a[$i] === null) {