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
# config valid only for Capistrano 3.1 | |
lock '3.1.0' | |
set :application, 'YourJouney' | |
set :repo_url, '[email protected]:yourjourney.git' | |
# Default branch is :master | |
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } | |
# Default deploy_to directory is /var/www/my_app |
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 | |
foreach($array as $element) { | |
if ($element === reset($array)) | |
echo 'FIRST ELEMENT!'; | |
if ($element === end($array)) | |
echo 'LAST ELEMENT!'; | |
} |
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 | |
public function video($fiche_id = null) | |
{ | |
$this->breadcrumb[] = array( | |
'text' => __('Gestion vidéo') | |
); | |
$zone_id = $this->request->params['named']['zone']; |
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
class AppController extends Controller { | |
public $components = array( | |
'Auth', | |
'Session', | |
); |
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::uses('AppController', 'Controller'); | |
App::uses('Folder', 'Utility'); | |
App::uses('File', 'Utility'); | |
App::uses('CakeTime', 'Utility'); | |
class ExampleController extends AppController { | |
public static $accept_types = array( |
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::uses('AppController', 'Controller'); | |
App::uses('Folder', 'Utility'); | |
App::uses('File', 'Utility'); | |
App::uses('CakeTime', 'Utility'); | |
class ExempleController extends AppController { | |
public function implementedEvents() | |
{ |
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 | |
namespace ES\SamsungCSBundle\Twig; | |
class CustomTwigExtension extends \Twig_Extension | |
{ | |
public function getFilters() | |
{ | |
return array( | |
new \Twig_SimpleFilter('slice_beautiful', array($this, 'beautifulTruncate')), |
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
@mixin media($point) { | |
@if $point == mobile { | |
@media screen and (max-width : em(768)) { @content ; } | |
} | |
@else if $point == tablet { | |
@media screen and (max-width : em(992)) and (min-width: em(768)) { @content ; } | |
} | |
@else if $point == laptop { | |
@media screen and (max-width : em(1200)) and (min-width: em(992)) { @content ; } | |
} |
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 | |
SESSIONNAME="work" | |
tmux has-session -t $SESSIONNAME > /dev/null | |
if [ $? != 0 ] | |
then | |
tmux new-session -s $SESSIONNAME -n "vagrant" -d | |
tmux new-window -t $SESSIONNAME:1 -n "vserver" |
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 | |
function get_posts_by_lang($args = array(), $lang = "fr") { | |
global $wpdb; | |
$post_table = $wpdb->posts; | |
$translation_table = $wpdb->prefix . 'icl_translations'; | |
$sql = " | |
SELECT ID |