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 | |
require 'deployer.phar'; | |
task('prod_server', function () { | |
connect('prod.ssh.test.com', 'user', 'password'); | |
}); | |
task('upload', function () { | |
upload(__DIR__, '/home/test'); |
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 | |
$Directory = new RecursiveDirectoryIterator(__DIR__); | |
$Iterator = new RecursiveIteratorIterator($Directory, RecursiveIteratorIterator::SELF_FIRST); | |
$Regex = new RegexIterator($Iterator, '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH); | |
echo'<pre>'; | |
var_dump($Regex); |
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
git filter-branch -f --index-filter 'git rm -r --cached --ignore-unmatch path/to/my/specific/file.ext' HEAD | |
git push -u origin master --force | |
Source : http://help.github.com/remove-sensitive-data/ |
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
<script> | |
moment.locale('fr'); | |
var now = moment(); | |
$('.time').each(function(i, e) { | |
var time = moment($(e).text(), $(e).data('moment-format')); | |
$(e).html(time.from(now)); | |
}); | |
</script> |
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 Swm\Bundle\ForumBundle\Listener; | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Swm\Bundle\MailHookBundle\Event\HookEventInterface; | |
/** | |
* @DI\Service() | |
*/ |
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
public function executeLogin(sfWebRequest $request) | |
{ | |
$this->form = new LoginForm(); | |
if ($request->isMethod('post')) | |
{ | |
$this->form->bind($request->getParameter('login')); | |
echo $request->getParameter('login[login]'); | |
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
$this->f_reponse = Doctrine_Query::create() | |
->select('p.*, u.*') | |
->from('post p') | |
->leftJoin('p.user u') | |
->where('p.subject_id = ?', $this->f_sujet->getId()) | |
->execute(); |
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
categorie: | |
tableName: categories | |
actAs: | |
Timestampable: ~ | |
Sluggable: | |
unique: true | |
fields: [titre] | |
canUpdate: false | |
columns: | |
titre: { type: string(100), notnull: true } |
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
$Login=''; | |
$Password=''; | |
$Tab[100]; | |
$j=0; | |
for ($i=48;$i<59;$i++){ | |
$Tab[$j]=$i; | |
$j++; | |
} | |
for ($i=65;$i<91;$i++){ |
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 | |
public function isAccessOk((array)$abonnements, (array)$userGroupes) | |
{ | |
$abonnements = array_flip($abonnements); | |
$userGrp = array_flip($userGroupes); | |
$at = array_merge($abos, $userGroupes); | |
return (bool)(count($at)<(count($abonnements)+count($userGroupes))); | |
} |
OlderNewer