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
{# Replicate \Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination::getPaginationData #} | |
{% set range = range ?? 5 %} | |
{% if pageCount < current %} | |
{% set current = pageCount %} | |
{% endif %} | |
{% if range > pageCount %} | |
{% set range = pageCount %} |
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
# When someone tries to login as root... | |
Match User root | |
# Denys all access except root@10.0.0.10 | |
AllowUsers root@10.0.0.10 | |
# See: http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/sshd_config.5?query=sshd%5fconfig&sec=5 |
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
/** | |
* Note: Also removes anything after the _ in the key. Useful for | |
* adding nodes with the same name. e.g. Node_1 and Node_2 both become Node. | |
* Appends child to argument by reference. | |
* @param array $element | |
* @param \SimpleXMLElement $parent | |
* @return \SimpleXMLElement | |
*/ | |
protected function arrayToXml (array $element, \SimpleXMLElement $parent) { | |
foreach ($element as $key => $child) { |
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
{% macro select (name, id, options, selected, required, includeBlank) %} | |
<select name="{{ name }}" id="{{ id }}" {{ required ? 'required' : '' }}> | |
{% if includeBlank %} | |
<option value=""></option> | |
{% endif %} | |
{% for key, value in options %} | |
{% if value is iterable %} | |
<optgroup label="{{ key }}"> | |
{% for subKey, subValue in value %} | |
<option value="{{ subKey }}" {{ subKey == selected ? 'selected' : '' }}>{{ subValue }}</option> |
NewerOlder