This file contains 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 | |
chdir(dirname(__DIR__)); | |
// Decline static file requests back to the PHP built-in webserver | |
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { | |
return false; | |
} | |
// Setup autoloading |
This file contains 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 Default_Model_Cidr | |
{ | |
public static function match($ip, $range) | |
{ | |
list ($subnet, $bits) = explode('/', $range); | |
$ip = ip2long($ip); | |
$subnet = ip2long($subnet); | |
$mask = -1 << (32 - $bits); |
This file contains 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
//Dependency: jQuery | |
$('form').bind("keyup, keypress", function(e) { | |
var code = e.keyCode || e.which; | |
if (code == 13) { | |
e.preventDefault(); | |
return false; | |
} | |
}); |
This file contains 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 | |
FILES=$1/* | |
for f in $FILES | |
do | |
# echo "Processing $f file..." | |
# take action on each file. $f store current file name | |
file $f | |
done |
This file contains 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
ps auxw | grep sbin/apache | awk '{print"-p " $2}' | xargs strace |
This file contains 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
http://labs.bigroomstudios.com/libraries/animo-js |
This file contains 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
DATUM=`date +%Y-%m-%d_%H-%M` | |
rsync --update -avW --delete-after --numeric-ids --stats -e "ssh -i /PATH/TO/.ssh/KEYFILE" /backup/ user@10.10.10.10:/raid/user/backup > /root/rsynclogs/rsync_$DATUM.log | |
# use --dry-run to simulate |
This file contains 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 Modul_UserController extends Zend_Controller_Action | |
{ | |
public function init() | |
{ | |
$front = Zend_Controller_Front::getInstance(); | |
$front->registerPlugin(new Module_Plugin_Login()); | |
$this->view->credentials = FUNCION_IS_LOGGED_IN(); |
This file contains 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 | |
namespace fsp; | |
class FilesystemProvider | |
{ | |
private $dir; | |
public $dirContent; | |
private $activeDirectory; |
This file contains 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 Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
protected $config; | |
protected function _initConfig() | |
{ | |
$this->config = $this->getOptions(); | |
Zend_Registry::set('config', $this->config); |