Skip to content

Instantly share code, notes, and snippets.

View domtra's full-sized avatar

Dominik Tränklein domtra

View GitHub Profile
# docker
wget -q -O - https://get.docker.io/gpg | apt-key add -
echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list
apt-get update -qq; apt-get install -q -y --force-yes lxc-docker
# Add vagrant user to the docker group
usermod -a -G docker vagrant
# packer
apt-get install unzip
wget https://dl.bintray.com/mitchellh/packer/0.5.2_linux_amd64.zip
apt-get update
apt-get -y upgrade
apt-get -y install build-essential zlib1g-dev libreadline-dev libssl-dev libcurl4-openssl-dev
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
echo '# rbenv setup' > /etc/profile.d/rbenv.sh
aaron
abacus
abandon
abandoned
abandoning
abandonment
abandons
abate
abatement
abba
@domtra
domtra / fieldGroup.json
Last active November 30, 2017 14:23
Flynt json schemas
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"definitions": {
"empty": {
"type": "string",
"maxLength": 0
},
"intOrEmpty": {
"oneOf": [
@domtra
domtra / .htaccess
Created November 7, 2019 08:48
CacheEnabler settings for flynt / bedrock
# BEGIN Cache Enabler
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# set blog sub path
SetEnvIf Request_URI "^(.*)$" SUB_PATH=/app/cache/cache-enabler/
# set Cache Enabler path
SetEnvIf Request_URI "^(.*)$" CE_PATH=$1
@domtra
domtra / curl.sh
Created November 13, 2019 14:09
curl with timings
curl -k -w " time_namelookup: %{time_namelookup}\n\
time_connect: %{time_connect}\n\
time_appconnect: %{time_appconnect}\n\
time_pretransfer: %{time_pretransfer}\n\
time_redirect: %{time_redirect}\n\
time_starttransfer: %{time_starttransfer}\n\
----------\n\
time_total: %{time_total}\n" -o /dev/null -s "$URL"
@domtra
domtra / functions.php
Created December 3, 2019 08:12
Store complex ACF fields as JSON
<?php
namespace Flynt\AcfPerformance;
define('ACF_STORE_AS_JSON', true);
add_action('acf/init', function () {
$types = acf()->fields->types;
replaceLoadValue($types);
if (defined('ACF_STORE_AS_JSON') && ACF_STORE_AS_JSON) {
@domtra
domtra / .htaccess
Last active December 15, 2020 12:52
stripped down h5bp .htaccess
# Apache Server Configs v3.2.1 | MIT License
# https://github.com/h5bp/server-configs-apache
<IfModule mod_rewrite.c>
RewriteEngine on
# RewriteCond %{HTTP_HOST} !^$
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# # RewriteCond %{HTTPS}s ^on(s)|
# # RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@domtra
domtra / .htaccess
Created June 5, 2020 14:02
php error reporting
# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
# enable PHP error logging
php_flag log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.log
# prevent access to PHP error log
<Files PHP_errors.log>
Order allow,deny

Mac Setup

  1. Install xcode command line tools

    xcode-select --install
  2. If you are on a M1 / Apple Silicon chip, install rosetta2

    /usr/sbin/softwareupdate --install-rosetta --agree-to-license