Skip to content

Instantly share code, notes, and snippets.

View domtra's full-sized avatar

Dominik Tränklein domtra

View GitHub Profile

setup tapas

nodejs on am64

Unfortunately nodejs does not provide compiled binaries for all nodejs version on arm64 at the moment. And propably never will. Only starting with version 15, you can easily install nodejs on arm64 without having to got through a lenghty compilation.

Additionally, not all node modules support arm64. Especially node-sass does not have arm64 support as of now.

With rosetta, however, we can run most nodejs applications successfully.

Development Environment

MySQL

We are using MySQL 5.7 in our development environment. This is the version that is included in All-Inkl hosting and in many other managed hosting packages.

  1. Install and link brew package
brew install mysql@5.7
brew link --force mysql@5.7

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
@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
@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 / 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 / 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 / .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 / 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": [
aaron
abacus
abandon
abandoned
abandoning
abandonment
abandons
abate
abatement
abba