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
program Hell; | |
function est_magique(n:integer): boolean; | |
var | |
a,i,somme,k:integer; | |
b : String; | |
begin | |
somme := 0; | |
for k := 3 to 8 do | |
begin | |
Str(n, b); // n par exemple 21025698 |
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
def listdiv(n): | |
L=[1] | |
fin=(n / 2) +1 | |
k=2 | |
while k<fin: | |
if n%k==0: | |
L +=[k] | |
k +=1 | |
return L |
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 | |
yum update -y | |
yum install -y httpd24 php56 mysql55-server php56-mysqlnd | |
service httpd start | |
chkconfig httpd on | |
groupadd www | |
usermod -a -G www ec2-user | |
chown -R root:www /var/www | |
chmod 2775 /var/www | |
find /var/www -type d -exec chmod 2775 {} + |
Événement | Description |
---|
// ... pour optimiser le nombre de requêtes exécutées par Doctrine. class User { // ...
/**
* @ORM\OneToOne(targetEntity=Address::class, cascade={"persist", "remove"}, inversedBy="user", fetch="EAGER")
*/
protected $address;
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 | |
//https://www.wanadev.fr/123-grace-a-faker-generez-des-donnees-aleatoires-dans-votre-base-de-donnees/ | |
// composer require fzaninotto/faker | |
namespace AppBundle\DataFixtures\ORM; | |
use AppBundle\Entity\User; | |
use Doctrine\Common\DataFixtures\AbstractFixture; |
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 | |
// app/AppKernel.php | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
public function registerBundles() | |
{ |
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
# fichier .htaccess qui se trouvera à la racine de mon site web hébergé chez OVH | |
######## URL rewriting ######### | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ web/$1 [QSA,L] | |
</IfModule> |
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
# Based on http://stackoverflow.com/questions/17313023/symfony-2-2-1-url-rewrite-issue | |
# Use the front controller as index file. It serves as fallback solution when | |
# every other rewrite/redirect fails (e.g. in an aliased environment without | |
# mod_rewrite). Additionally, this reduces the matching process for the | |
# startpage (path "/") because otherwise Apache will apply the rewritting rules | |
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). | |
DirectoryIndex app.php | |
#DirectoryIndex app_dev.php |
NewerOlder