Skip to content

Instantly share code, notes, and snippets.

View apphancer's full-sized avatar

Martin apphancer

View GitHub Profile
@apphancer
apphancer / install_wkhtmltopdf_on_centos.sh
Last active May 31, 2020 21:58
Install wkhtmltopdf 0.12.4 on CentOS 6.x and 7.x
# 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 / register.html.twig
Created April 18, 2019 12:28 — forked from ThePeterMick/register.html.twig
Display label and checkbox separately for bootstrap 4 in Twig for Symfony 4
{% 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 / .htaccess
Last active February 6, 2018 21:44
Symfony 4 public/.htaccess file missing after running $ composer require symfony/apache-pack
# 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 / package.json
Created January 16, 2018 16:08 — forked from elmariachi111/package.json
webpack production demo file
{
"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 / yii_paths.php
Created November 1, 2017 18:30
Yii Relative and Absolute URLs/Directories/Paths #yii1
<?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 / Vagrantfile
Created August 10, 2017 10:49 — forked from aboutte/Vagrantfile
Vagrantfile to set some time synchronization configs
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