Skip to content

Instantly share code, notes, and snippets.

Avatar

AlexanderAllen AlexanderAllen

  • New York, NY
View GitHub Profile
@AlexanderAllen
AlexanderAllen / run.bat
Last active May 14, 2020
Electron WideVine CDN test
View run.bat
:: Basic test.
::npx electron .
:: Documentation https://www.electronjs.org/docs/tutorial/testing-widevine-cdm
@echo off
set widevine-cdm-path=C:\Program Files (x86)\Google\Chrome\Application\81.0.4044.138\WidevineCdm\_platform_specific\win_x64\widevinecdm.dll
@AlexanderAllen
AlexanderAllen / docker-compose.yml
Created Feb 1, 2020
Switching to unix socket with named volumes for PHP FPM and Nginx
View docker-compose.yml
# Staying on version 2.x for performance tuning cpu, memory resources.
# Ver. 3.x is meant for swarms and is not 100% backwards-compat.
# Secrets are available only on 3.x.
version: '3.7'
networks:
default:
external: true
name: localenv
services:
@AlexanderAllen
AlexanderAllen / Makefile
Created Jan 31, 2020
Docker workload excerpt
View Makefile
# The php files are mounted from the host so access is slow.
slow: pull www
docker run --rm --name symfony-demo -p 8080:8080 -v $(shell pwd)/www:/var/www djs55/symfony-demo
@AlexanderAllen
AlexanderAllen / docker-compose.yml
Created Jan 14, 2020
Forward logs to Nginx as non-root user, by using the tty parameter
View docker-compose.yml
nginx:
image: alexanderallen/nginx:1.17-alpine
tty: true
entrypoint: 'su-exec nobody /usr/sbin/nginx -g "daemon off;"'
ports:
- 80:8080
- 443:443
healthcheck:
test: curl --fail -s http://localhost:80 || exit 1
interval: 30s
@AlexanderAllen
AlexanderAllen / default.conf
Created Jan 4, 2020
Final nginx default conf
View default.conf
server {
listen 8080;
server_name localhost;
root /app/web; ## <-- Your only path reference.
location = /favicon.ico {
log_not_found off;
access_log off;
}
@AlexanderAllen
AlexanderAllen / gist:acbb48afd3811595b1df345dc4275577
Created Jan 3, 2020
Does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v1.11+.
View gist:acbb48afd3811595b1df345dc4275577
Deprecation Notice: Class Drush\Internal\Config\Yaml\Tag\TaggedValue located in ./vendor/drush/drush/src/internal-forks/Config/Yaml/Tag/TaggedValue.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v1.11+. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:185
Stack trace:
phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:108
phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:338
phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:321
phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:259
phar:///usr/local/bin/composer/src/Composer/Installer.php:306
phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:122
phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
@AlexanderAllen
AlexanderAllen / composer.json
Created Jan 3, 2020
Drush 9 Composer Manifest
View composer.json
{
"name": "alexanderallen/php-cli.drush9",
"description": "Composer dependencies for Drupal 8.4+ development.",
"require": {
"drush/drush": "~9.0",
"symfony/yaml": "~3.0",
"pear/pear-core-minimal": "1.10.1"
}
}
@AlexanderAllen
AlexanderAllen / marie-kondo'd.Dockerfile
Created Jan 3, 2020
Optimized Dockerfile for Composer and Drush, moved optional tooling into new, optional build targets.
View marie-kondo'd.Dockerfile
FROM alexanderallen/php7-fpm.core:alpine-3.11 as core
ENV \
SSH_PRIVATE_KEY="/root/.ssh/id_rsa" \
LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
LANGUAGE="en_US.UTF-8" \
TERM="xterm" \
# Register the COMPOSER_HOME environment variable.
COMPOSER_HOME=/composer \
@AlexanderAllen
AlexanderAllen / bloatware_corporation.Dockerfile
Last active Jan 3, 2020
Or, how not to build Dockerfiles
View bloatware_corporation.Dockerfile
FROM alexanderallen/php7-fpm.core:alpine-3.11 as core
ENV \
SSH_PRIVATE_KEY="/root/.ssh/id_rsa" \
LANG="en_US.UTF-8" \
LC_ALL="en_US.UTF-8" \
LANGUAGE="en_US.UTF-8" \
TERM="xterm" \
# Register the COMPOSER_HOME environment variable.
COMPOSER_HOME=/composer \
@AlexanderAllen
AlexanderAllen / .bashrc
Created Jan 3, 2020
Apply proper umask on WSL
View .bashrc
# Note: Bash on Windows does not currently apply umask properly, fix it here.
if [[ "$(umask)" = "0000" ]]; then
umask 0022
fi
You can’t perform that action at this time.