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 | |
/** | |
* @param array $array | |
* | |
* @return array | |
*/ | |
protected function translate($array) | |
{ | |
$filtersChoicesTrans = []; | |
foreach ($array as $key => $value) { |
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
$ ./ngrok http -region eu -host-header=rewrite {LocalSiteName}.local:80 | |
// On browser or mobile browser, share page like: | |
http://bae8d36b.eu.ngrok.io |
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
// allow history for root user on container | |
// on /root/.bashrc | |
// add: | |
HISTFILE="/root/.bash_history" |
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
// parent_template.html.twig | |
{% include "AppBundle:fields:input_text.html.twig" with { | |
'form_id': form_id, | |
'field_name': 'Numéro', | |
'required': true, | |
'attr': { | |
'data-minlength': '\\d{7}', | |
'minlength': '7', | |
'maxlength': '7', | |
'data-error': 'e0.message_error'|trans() |
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
<div class="row"> | |
<div class="col-md-9"> | |
<div class="row"> | |
{% if children is defined and children.pager.currentPageResults|length %} | |
{% for child in children.pager.currentPageResults %} | |
{% if loop.index0 % 2 == 0 and not loop.first %} | |
</div> | |
<div class="row"> | |
{% endif %} |
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
# http://stackoverflow.com/questions/7244321/how-to-update-a-github-forked-repository | |
# Add the remote, call it "upstream": | |
git remote add upstream https://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches, | |
# such as upstream/master: | |
git fetch upstream | |
# Make sure that you're on your master branch: |
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 file | |
# vi /storage/.config/hyperion.config.json | |
// restart service | |
# /bin/sh /storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json |
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
# Show size of each folder | |
$ du -sch * | sort -h | |
# Count number of files in a folder | |
$ find . -name \* | wc -l | |
# Search a file (or pattern) and execute a command (rm here) | |
$ find . -name ’*.yml’ -exec rm {} ; | |
# Add a line at the end of a file |
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
// Update/Add a new field | |
Rooms.update({_id: 'XDhybphgkdC7Z4dsn'}, {$set: {user: 'Laurent'}}); | |
// Add array | |
Rooms.update({_id: 'XDhybphgkdC7Z4dsn'}, {$set: {objects: ['TV', 'Radio', 'Draps'] } } ); | |
// Push a field in an array | |
Rooms.update({_id: 'XDhybphgkdC7Z4dsn'}, {$push: {objects: ['Lights'] } } ); | |
// Push an array in an 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
/* Afficher une image */ | |
<img src="{$node.object.data_map.my_image.content[image_size].full_path}" ... /> | |
/* Afficher le contenu d'un bloc XML */ | |
{$node.object.data_map.my_xml.content.output.output_text} | |
/* Afficher un timestamp au format souhaité */ | |
{$node.data_map.date_from.data_int|datetime(custom, '%l %d %F %Y')} | |
custom, '%d/%m/%y' |
NewerOlder