Skip to content

Instantly share code, notes, and snippets.

@nexocentric
nexocentric / gist:9223248
Created February 26, 2014 03:54
functions for checking directory permissions
function checkFilePermissions($filename)
{
if(!file_exists($filename)) {
return "filename does not file_exists";
}
if(!is_file($filename)) {
return "filename does not is_file";
}
if(!is_readable($filename)) {
return "filename does not is_readable";
<!-- start scripts for auto reloading=> -->
<meta name="previousUpdateStatusList" content="">
<meta name="monitorList" content="./htdocs/cmtrend_stop.php,./htdocs/style.css,./template/cmtrend_stop.tmpl,./lib/libcommon,./lib/libcable,./lib/libpage,./lib/libcable,./conf/1217141131.00,./conf/1217141131.01,./conf/1217141131.02,./conf/1217141131.03,./conf/1217141131.04,./conf/1217141131.05,./conf/1217141131.06,./conf/1217141131.07,./conf/1217141131.08,./conf/1217141131.09">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript">
var ajaxHandlerPath = 'http://192.168.2.175/~dzakuma/update-monitor.php';
var ajaxRequest = null;
var ajaxTimeout = 300000;
function showUpdated(json)
<?php
#===========================================================
# [author]
# Dodzi Y. Dzakuma
# [summary]
# This function checks if a superglobal parameter is set in
# specified superglobal. If no superglobal is specified this
# function will check the $_REQUEST superglobal by default.
# [parameters]
@nexocentric
nexocentric / gist:7783818
Created December 4, 2013 08:00
ANSI COLOR CODES by name
Pink colors
Pink
LightPink
HotPink
DeepPink
PaleVioletRed
MediumVioletRed
Red colors
LightSalmon
Salmon
function down($array,$element) {
if(count($array)-1 > $element) {
$newArray = array_slice($array,0,$element,true);
$newArray[] = $array[$element+1];
$newArray[] = $array[$element];
$newArray += array_slice(
$array,
$element+2,
count($array),