<?php
/**
* Function to mimic php's empty() function (it is the same)
*/
function is_empty($mixed)
{
return empty($mixed);
}
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
{ | |
state: open | |
settings: { | |
index.number_of_replicas: 1 | |
index.version.created: 190499 | |
index.number_of_shards: 5 | |
} | |
mappings: { | |
shop: { |
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 showFormsActions() { | |
return $this->generateForms(); | |
} | |
public function processFormAction() { | |
/* Traiter le $form */ | |
if ($form->isValid()) { |
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
// Adds an event handler | |
$('#my_datepickerized_field').datepicker( 'option' , 'onSelect', function (date) { // 'onSelect' here, but could be any datepicker event | |
$(this).change(); // Lauch the "change" evenet of the <input> everytime someone click a new date | |
}); |
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 Main { | |
public static void main(String args[]) { | |
System.out.println("Bonjour le monde!"); | |
} | |
} |
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
<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer"> | |
<exec executable="phpcs"> | |
<arg value="-p" /> | |
<arg value="--report=checkstyle" /> | |
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" /> | |
<arg path="${basedir}/src" /> | |
</exec> | |
</target> |
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
function quickAlex() { console.log('Alexxxxx') }; | |
function quickClem() { console.log('Clemmmmm') }; | |
function quickTim() { console.log('Timmmm') }; | |
$(document).ready(function () { | |
var isQuickRegex = new RegExp("quick.*"); | |
for (var f in window) { | |
if (window.hasOwnProperty(f) && typeof window[f] === 'function' && isQuickRegex.test(window[f])) { | |
window[f](); |
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
"require-dev": { | |
"behat/symfony2-extension": "dev-master", | |
"behat/mink-extension": "dev-master", | |
"behat/mink-browserkit-driver": "dev-master", | |
"behat/mink-selenium2-driver": "dev-master" | |
}, | |
"config": { | |
"bin-dir": "bin" | |
} |
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/sh | |
ps -ef|grep selenium|grep -v grep|awk '{print $2}'|xargs kill -9 |
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 > echo strlen("Available for order in Cologne of 05/16/2012 6:45 to 05/26/2012 ? payment 10 € Per day"); | |
88 | |
php > echo mb_strlen("Available for order in Cologne of 05/16/2012 6:45 to 05/26/2012 ? payment 10 € Per day"); | |
86 |