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
# First, create the synonyms file /opt/elasticsearch/name_synonyms.txt | |
# with the contents: | |
# | |
# rob,bob => robert | |
# | |
## CREATE THE INDEX WITH ANALYZERS AND MAPPINGS | |
curl -XPUT 'http://127.0.0.1:9200/test/?pretty=1' -d ' | |
{ |
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 | |
// Works in every situations | |
function by_token ($src) { | |
$class = false; | |
$namespace = false; | |
$tokens = token_get_all($src); | |
for ($i = 0, $count = count($tokens); $i < $count; $i++) { | |
$token = $tokens[$i]; |
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
/** | |
* Description | |
* | |
* @param hey | |
* | |
* @return pwet | |
* | |
* @Mongo/Hey | |
* @Assert/Url() | |
*/ |
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
var tabInventaire = new Array ("dague","epee","arc","bouclier", "potion"); | |
var tempInventaire = new Array (); | |
for (var i = 0; i < tabInventaire.length; i++) | |
{ | |
if (tabInventaire[i] != "epee" || tabInventaire(i) != "arc") | |
} | |
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
var tabInventaire = ["dague","arc", "bombe","epee","fleche","epee","arc"]; | |
trace(tabInventaire); | |
// Le joueur vient de faire une chute vertigineuse. | |
// Dans sa chute il casse involotairement ses epées et ses arcs. | |
// Trouvez l'algo permettant de retirer de l'inventaire tous les épées et les arcs | |
// Sachant que l'inventaire ne peut pas contenir d'objet "null" ou vide. |
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
// Ouvre le premier lien enfant de l'élément cible | |
// Reproduit le comportement des navigateurs (ctrl ou cmd ou middleclick = nouvel onglet) | |
$('.line-click').live('click', function(e){ | |
e.stopPropagation(); | |
href = $(this).children('a:first').attr('href'); | |
if (e.ctrlKey || e.metaKey || e.which == 2) { | |
window.open(href); | |
} else { | |
window.location = href; | |
} |