You are going to install some things. Login in root or use sudo for most of the followings commands.
su -
First you need git.
yum install git
You are going to install some things. Login in root or use sudo for most of the followings commands.
su -
First you need git.
yum install git
// | |
// With classic callbacks | |
// | |
var callApi = function(success) { | |
$.ajax({ | |
url: '/hello', | |
success: function(data) { | |
// Do callApi stuff here. |
Count how many variables have an underscore inside
grep -E -r --include=*.php "[$][a-zA-Z\x7f-\xff]([a-zA-Z0-9\x7f-\xff]*_[a-zA-Z0-9\x7f-\xff]*)+" . | wc -l
Count how many variables have no underscore inside
grep -E -r --include=*.php "[$][a-zA-Z\x7f-\xff][a-zA-Z0-9\x7f-\xff]*" . | wc -l
The regex is from : http://php.net/manual/en/language.variables.basics.php
Process: php [14202] | |
Path: /usr/bin/php | |
Identifier: php | |
Version: ??? (???) | |
Code Type: X86-64 (Native) | |
Parent Process: bash [5788] | |
Date/Time: 2012-05-24 02:27:12.208 +0200 | |
OS Version: Mac OS X 10.7.4 (11E53) | |
Report Version: 9 |
// This feels weird, usually create returns a new instance or something like that | |
$entry = new TimelineAction(); | |
$entry->create($chuckNorrisObject, 'control', 'The world'); | |
// This would be better | |
$entry = TimelineAction::create($chuckNorrisObject, 'control', 'The world'); | |
// Or maybe something more like that | |
$entry = new TimelineAction(); | |
$entry->configure/setup/fill/etc...($chuckNorrisObject, 'control', 'The world'); |
<?php | |
class A | |
{ | |
public static function create() | |
{ | |
return new static(); | |
} | |
} |
SELECT RELATION_ID(p.author) AS author_id | |
FROM Post AS p |
// On utilise toujours ca .... | |
try { | |
$result = $qb->getQuery()->getSingleResult(); | |
} catch (NoResultException $e) { | |
$result = null; | |
} | |
// Mais magie, magie, cette méthode non documentée fait la meme chose! | |
$result = $qb->getQuery()->getOneOrNullResult(); |
{ | |
"name": "jms/payment-core-bundle", | |
"type": "symfony-bundle", | |
"description": "This bundle is providing the foundation for various payment plugins.", | |
"keywords": ["payment"], | |
"homepage": "http://jmsyst.com/bundles/JMSPaymentCoreBundle", | |
"license": "Apache2", | |
"authors": [ | |
{ | |
"name": "Johannes M. Schmitt", |
<?php | |
/* | |
* This file is part of the Symfony package. | |
* | |
* (c) Fabien Potencier <fabien@symfony.com> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |