Skip to content

Instantly share code, notes, and snippets.

View ahmed-bhs's full-sized avatar
👽

Ahmed EBEN HASSINE 脳の流れ ahmed-bhs

👽
View GitHub Profile
@ahmed-bhs
ahmed-bhs / .htaccess
Last active December 20, 2017 11:39
symfnoy mod rewrite
# 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
@ahmed-bhs
ahmed-bhs / l'url rewriting, la gestion du cache, la compression et la sécurité
Created November 4, 2017 20:53
Symfony'url rewriting, la gestion du cache, la compression et la sécurité
# 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>
@ahmed-bhs
ahmed-bhs / AppKernel.php
Created November 5, 2017 21:41 — forked from kbond/AppKernel.php
JWT Authentication With Symfony Guard. POST username/password to /login to receive token, /api* requests require a valid token
<?php
// app/AppKernel.php
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
public function registerBundles()
{
<?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;

// ... 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;
Événement Description
#!/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 {} +
@ahmed-bhs
ahmed-bhs / test.py
Last active January 27, 2018 18:36
def listdiv(n):
L=[1]
fin=(n / 2) +1
k=2
while k<fin:
if n%k==0:
L +=[k]
k +=1
return L
@ahmed-bhs
ahmed-bhs / est_magique.pas
Last active January 28, 2018 10:01
est_magique
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
  1. Fix title favcion : <link rel="shortcut icon" href="/favicon.ico" />
  2. Fix challenge backround color rgb(220, 253, 224), if they are solved.
  3. Add a new tag for challenges that has been published recently (1week)
  4. Add social icons in the scoreboard