Skip to content

Instantly share code, notes, and snippets.

Martin apphancer

Block or report user

Report or block apphancer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@apphancer
apphancer / register.html.twig
Created Apr 18, 2019 — forked from ptrm04/register.html.twig
Display label and checkbox separately for bootstrap 4 in Twig for Symfony 4
View register.html.twig
{% form_theme form _self %}
{% block checkbox_widget -%}
{%- set parent_label_class = parent_label_class|default(label_attr.class|default('')) -%}
{%- if 'checkbox-custom' in parent_label_class -%}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' custom-control-input')|trim}) -%}
<div class="custom-control custom-checkbox{{ 'checkbox-inline' in parent_label_class ? ' custom-control-inline' }}">
{{ block('checkbox_widget_base') }}
</div>
{%- else -%}
@apphancer
apphancer / package.json
Created Jan 16, 2018 — forked from elmariachi111/package.json
webpack production demo file
View package.json
{
"name": "symfony",
"version": "1.0.0",
"description": "Symfony Standard Edition ========================",
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
@apphancer
apphancer / .htaccess
Last active Feb 6, 2018
Symfony 4 public/.htaccess file missing after running $ composer require symfony/apache-pack
View .htaccess
# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php
# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
@apphancer
apphancer / yii_paths.php
Created Nov 1, 2017
Yii Relative and Absolute URLs/Directories/Paths #yii1
View yii_paths.php
<?php
// returns app absolute URL
var_dump(Yii::app()->getBaseUrl(true));
// returns theme directory relative URL
var_dump(Yii::app()->theme->baseUrl);
// returns web relative URL
var_dump(Yii::app()->baseUrl);
@apphancer
apphancer / install_wkhtmltopdf_on_centos.sh
Last active Feb 5, 2020
Install wkhtmltopdf 0.12.4 on CentOS 6.x and 7.x
View install_wkhtmltopdf_on_centos.sh
# Install dependencies (if needed)
$ yum install -y xorg-x11-fonts-75dpi
$ yum install -y xorg-x11-fonts-Type1
$ yum install xz
# Get latest version of wkhtmltopdf (replace version number if needed)
$ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
# Untar and move wkhtmltox
$ unxz wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
@apphancer
apphancer / Vagrantfile
Created Aug 10, 2017 — forked from aboutte/Vagrantfile
Vagrantfile to set some time synchronization configs
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |virtualbox|
# set timesync parameters to keep the clocks better in sync
# sync time every 10 seconds
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-interval", 10000 ]
# adjustments if drift > 100 ms
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-min-adjust", 100 ]
# sync time on restore
virtualbox.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-on-restore", 1 ]
# sync time on start
You can’t perform that action at this time.