Creating a new PHPExcel Object.
$this->PHPExcel = new PHPExcel();
Creating a new sheet:
### ENVIRONMENT VARIABLES ### | |
SetEnv PHP_VER 5 | |
SetEnv REGISTER_GLOBALS 0 | |
### MAIN DEFAULTS ### | |
Options All -Indexes | |
DirectoryIndex index.html index.htm index.php | |
AddDefaultCharset UTF-8 | |
### MIME TYPES ### |
<?php | |
function removeCommonWords($input){ | |
// EEEEEEK Stop words | |
$commonWords = array('a','able','about','above','abroad','according','accordingly','across','actually','adj','after','afterwards','again','against','ago','ahead','ain\'t','all','allow','allows','almost','alone','along','alongside','already','also','although','always','am','amid','amidst','among','amongst','an','and','another','any','anybody','anyhow','anyone','anything','anyway','anyways','anywhere','apart','appear','appreciate','appropriate','are','aren\'t','around','as','a\'s','aside','ask','asking','associated','at','available','away','awfully','b','back','backward','backwards','be','became','because','become','becomes','becoming','been','before','beforehand','begin','behind','being','believe','below','beside','besides','best','better','between','beyond','both','brief','but','by','c','came','can','cannot','cant','can\'t','caption','cause','causes','certain','certainly','changes','clearly','c\'mon','co','co.','com','come','comes','concerni |
<?php | |
//initialize | |
$ch = curl_init(); | |
// 2. set the options, including the url | |
curl_setopt($ch, CURLOPT_URL, "https://api.pingdom.com/api/2.0/traceroute?host=techslides.com"); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array("App-Key: YOUR-KEY-HERE")); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 0); |
<script> | |
function showLink() { | |
document.getElementById("theLink").setAttribute("href","http://www.google.com"); //URL to show | |
} | |
function clickJack() { | |
document.getElementById("theLink").setAttribute("href","http://www.bing.com"); //URL that it actually goes to | |
} | |
</script> | |
<a id="theLink" href="#" onmouseover="showLink()" onmousedown="clickJack()">Click me</a> |
<?php | |
$files = glob("*.tar.gz"); | |
foreach($files as $file) { | |
if(is_file($file) | |
&& time() - filemtime($file) >= 7*24*60*60) { // 7 days | |
unlink($file); | |
} | |
} | |
?> |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
<?php | |
session_start(); | |
define('LOG', '/path/to/log/file'); | |
if (isset($_GET['ajax'])) { | |
$handle = fopen(LOG, 'r'); | |
fseek($handle, 0, SEEK_END); | |
$offset = ftell($handle); |
String.prototype.imgURL = function(size) { | |
// remove any current image size then add the new image size | |
return this | |
.replace(/_(pico|icon|thumb|small|compact|medium|large|grande|original|1024x1024|2048x2048|master)+\./g, '.') | |
.replace(/\.jpg|\.png|\.gif|\.jpeg/g, function(match) { | |
return '_'+size+match; | |
}) | |
; | |
}; |