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 | |
$examples = array( | |
'../' => '' | |
, '/../' => '' | |
, 'abc/../' => 'abc' | |
, '../def' => 'def' | |
, '/../def' => 'def' | |
, 'abc/../../def' => 'abc/def' | |
, 'abc../' => 'abc..' |
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 | |
/** | |
* Declaring variables | |
*/ | |
$output = array(); | |
$return_var = null; | |
/** | |
* Get environment variables |
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 | |
print_r(apache_request_headers()); | |
foreach ($_SERVER as $key => $val) | |
{ | |
if (sscanf($key, 'HTTP_%s', $header) === 1) | |
{ | |
// take SOME_HEADER and turn it into Some-Header | |
$header = str_replace('_', ' ', strtolower($header)); |
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 | |
case $1 in | |
-clean|clean) | |
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse -clean | |
;; | |
*) | |
[ $# -gt 0 ] && | |
FILES="$@" || | |
while read _FILES |
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 | |
abstract class M3SystemProperty_model extends MY_Model | |
{ | |
/** | |
* @var M3SystemProperty_model | |
*/ | |
protected $system_property_api = null; | |
protected $system_property_cache = array('enabled'=>FALSE, 'expiry'=>300, 'driver'=>null); | |
protected static $GET_SYSTEM_PROPERTY = '/system/property/%s'; |
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 | |
function autoinst() | |
{ | |
declare -a _list=() | |
for i | |
do | |
command -v "$i" > /dev/null || _list[${#_list[@]}]="$i" | |
done | |
test ${#_list[@]} -eq 0 && return |
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 varDebugPdoMysqlLog | |
{ | |
private $_fileName = 'var/debug/pdo_mysql.log.newdesign'; | |
private $_filterKeys = array('datetime', 'pid', 'type', 'SQL', 'BIND', 'AFF', 'TIME'); | |
// private $_filterKeys = array('type', 'SQL', 'BIND'); | |
private $_skipTables = array( | |
'admin_user' | |
, 'eav_entity_store' |
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 | |
function breakup() | |
{ | |
LAST=$(wc -l "$1" | xargs | cut -d' ' -f1) | |
LAST=$(($LAST + 1)) | |
grep -no ^201.-..-.. "$1" | sort -u -t: -k2 | sort -t: -rnk1 | while read j | |
do | |
DATE=$(echo $j | cut -d: -f2) | |
LINE=$(echo $j | cut -d: -f1) |
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 | |
$handle = fopen($argv[1], 'r'); | |
$handle || exit('no readable file'); | |
$handles = array(); | |
while (($line = fgets($handle)) !== false) | |
{ | |
if (preg_match('/^201.-..-../', $line, $match)) |
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
#!/usr/bin/env bash | |
# Source git completion and git prompts | |
command -v __git_ps1 > /dev/null || | |
for i in git-completion.bash git-prompt.sh | |
do | |
echo source ~/bin/$i | |
source ~/bin/$i | |
done | |
if declare -f __git_ps1 2>&1 >/dev/null |
OlderNewer