Skip to content

Instantly share code, notes, and snippets.

View vladzloteanu's full-sized avatar

Vlad Zloteanu vladzloteanu

View GitHub Profile
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="control-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ field.id }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}:
function getReadableFileSizeString(fileSizeInBytes) {
var i = -1;
var byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
do {
fileSizeInBytes = fileSizeInBytes / 1024;
i++;
} while (fileSizeInBytes > 1024);
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
};
- name: Get hostname
shell: echo $HOSTNAME
register: local_hostname
delegate_to: localhost
- name: Get current user
shell: whoami
register: local_user
delegate_to: localhost
# DockerFile
FROM php:5.6-cli
# Install Composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
#RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN apt-get -qq update && apt-get -qq install mysql-client python3 libxml++2.6-dev > /dev/null