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 | |
namespace Controllers; | |
use OAuth\Common\Service\AbstractService; | |
use OAuth\Common\Storage\Session as OAuthSession; | |
class AuthController extends ControllerBase { | |
// everytime we enter the controller, then we check for login, if yes, then we dont have to access here (except logout) |
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
### Caching mod_headers + mod_expires | |
<IfModule mod_expires.c> | |
# Turn on Expires and set default to now | |
ExpiresActive On | |
ExpiresDefault "now" | |
# Set up caching on media files for 1 month | |
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|swf)$"> |
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 | |
BIN_DIRECTORY=$1 | |
USER=$2 | |
usage () | |
{ | |
echo "Usage : $0 bin_directory owner" | |
} | |
if [[ $EUID -ne 0 ]]; then |
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 | |
namespace Test; | |
abstract class PHPUnitTestDb extends \PHPUnit_Extensions_Database_TestCase | |
{ | |
// one instance per whole test | |
static private $pdo = null; | |
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 | |
# prints a color table of 8bg * 8fg * 2 states (regular/bold) | |
echo | |
echo Table for 16-color terminal escape sequences. | |
echo Replace ESC with \\ 033 in bash. | |
echo | |
echo "Background | Foreground colors" | |
echo "---------------------------------------------------------------------" | |
for((bg=40;bg<=47;bg++)); do |
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 | |
echo "<pre>\n"; | |
if (ini_get('safe_mode')) { | |
echo "[safe_mode enabled]\n\n"; | |
} else { | |
echo "[safe_mode disabled]\n\n"; | |
} | |
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
# COPY DIRECTORY /source/dir FROM myhost to /destination/dir on the localhost WITH THE SSH SHELL | |
rsync -avz -e "ssh" user@myhost:/source/dir /destination/dir | |
### OPTIONS | |
# -a for archive mode (recursive, copys symlink, copys permissions, copys update times, preserves owner) | |
# -v for verbose (writes what it does) | |
# -z for compress while transfering | |
# SAME BUT WE EXCLUDE SOME FILES/DIR | |
rsync -avz -e "ssh" \ |
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
cd /path/to/sessions; find -cmin +24 | xargs rm | |
# to try : | |
# find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -print0 | xargs -r -0 rm |
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
// this is a multisortToolbr which should override a basical toolbar. It can be added as toolbar for a grid. Then you can drop columns from the column model of the grid and it will sort grid as following example : http://docs.sencha.com/extjs/4.2.0/extjs-build/examples/build/KitchenSink/ext-theme-neptune/#multi-sort-grid. | |
// It is almost an adapted version of the code used in the example. | |
Ext.define('myApp.view.override.MultiSortToolbar', { | |
override: 'myApp.view.MultiSortToolbar', | |
requires: [ |
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
SELECT | |
Table_Catalog | |
,Table_Schema | |
,Table_Name | |
,Column_Name | |
,Column_Type | |
FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE Table_Schema = "nom de la base à lister" |