Skip to content

Instantly share code, notes, and snippets.

View teeyo's full-sized avatar

TAOUFIK Oussama teeyo

View GitHub Profile
@teeyo
teeyo / index.php
Created December 9, 2016 10:15
An example of why you should use Memcached and cache in general
<?php
// database host
$host = '127.0.0.1';
// database name
$db = 'cache';
// database user
$user = 'homestead';
// the easiest password in the world
$pass = 'secret';
<?php
webform_node_view($node,'full');
print theme_webform_view($node->content);
?>
@teeyo
teeyo / SecurityController.php
Last active May 1, 2017 12:00
Redirecting authenticated users when they try to access login page. [FOSUserBundle - Symfony 3]
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@teeyo
teeyo / RegistrationController.php
Created May 1, 2017 12:09
Redirecting authenticated users when they try to access registration page. [FOSUserBundle - Symfony 3]
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@teeyo
teeyo / config
Created June 8, 2017 10:19
Synchronize push on Bitbucket/Github and Drupal Cloud
# Edit the .git/config file, and add as many pushURL as you like, this way whenever you do a git push you'll be
# pushing to all the URLs yous specified in the pushURL parameter. In my case I use it to push to BitBucket and
# Drupal Cloud at the same time.
[remote "origin"]
url = https://teeyo@bitbucket.org/teeyo/repository.git
fetch = +refs/heads/*:refs/remotes/origin/*
# add your pushURL as shown below
pushURL = https://teeyo@bitbucket.org/teeyo/repository.git
pushURL = teeyo@git.drupal.org:project/repository.git
@teeyo
teeyo / remove-remote-tag.git
Last active June 21, 2017 12:06
Remove a remote tag GIT
git push --delete origin YOUR_TAG_NAME