This file contains 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 | |
class baseDog | |
{ | |
public $name; | |
} | |
class dog | |
{ | |
protected $name; |
This file contains 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 | |
VIDEO_FOLDER=( | |
/PATH/TO/MOVIE1 | |
/PATH/TO/MOVIE2 | |
) | |
VIDEO_EXTENTION=(avi mkv mpg mpeg) | |
OUTPUT='movie_list.txt' | |
OUTPUT_TEMP=${OUTPUT}.temp |
This file contains 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
Description | |
----------- | |
For twig, a string equals 0 | |
Test script | |
----------- | |
{% set test = 'a string' %} | |
{% if test == 0 %} | |
test == 0 |
This file contains 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
{# manipulation des variables #} | |
{% set une_string = 'test' %} | |
<p> | |
{{ une_string }} | |
</p> | |
<hr /> |
This file contains 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 | |
class Project_Set_Node extends Twig_Node | |
{ | |
public function __construct($name, Twig_Node_Expression $value, $lineno) | |
{ | |
parent::__construct(array('value' => $value), array('name' => $name), $lineno); | |
} | |
public function compile(Twig_Compiler $compiler) | |
{ |
This file contains 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
<html> | |
<?php | |
var_dump($_FILES); | |
if (isset($_FILES['test'])) { | |
$filetemp = $_FILES['test']['tmp_name']['file01']; | |
echo 'file tmp location : '.$filetemp.'<br />'; | |
echo 'is file on disk ? : '.file_exists($filetemp).'<br />'; | |
} |
This file contains 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
MODULES=( | |
plugins/ftAttractionPlugin | |
plugins/ftCalendarPlugin | |
plugins/ftCommonPlugin | |
plugins/ftContentPlugin | |
plugins/ftFormPlugin | |
plugins/ftHotelRestaurantPlugin | |
plugins/ftListingPlugin | |
plugins/ftMasterCatalogPlugin | |
plugins/ftNewsTipsPlugin |
This file contains 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
i = 0 | |
for dump in dumps: | |
print cyan('%(i)s => %(dump)s' % {'i':i, 'dump':dump}) | |
i += 1 | |
def validateDumpNumber(arg): | |
if i < int(arg): | |
raise Exception('You have to choose an int among [0-%(i)s], not %(arg)s' % {'i':i, 'arg':arg}) | |
return arg |
This file contains 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
Starting benchmark, it takes several minutes... | |
1010 files | |
110 directories | |
10 iterations | |
18 cases | |
2 adapters |
This file contains 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 | |
$list = array_merge(range('a', 'z'), range('A', 'Z'), range(0, 9)); | |
function getRandomString($length, $list) { | |
$str = array_fill(0, $length, null); | |
$str = array_map(function($item) use ($list) { return $list[array_rand($list)]; }, $str); | |
return join($str, ''); | |
} |
OlderNewer