Skip to content

Instantly share code, notes, and snippets.

View sparkalow's full-sized avatar

Brian M. sparkalow

  • null
View GitHub Profile
@sparkalow
sparkalow / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 12, 2017 18:18 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@sparkalow
sparkalow / product.twig
Created December 9, 2021 18:48 — forked from piotrpog/product.twig
commerce product page with sprig
{% extends 'shop/_layouts/main' %}
{% block main %}
{{ sprig('product_content', {productId: product.id}) }}
{{ sprig.script }}
{% endblock %}
@sparkalow
sparkalow / xdebug.sh
Created March 18, 2022 22:11 — forked from carstenwindler/xdebug.sh
Bash script to quickly enable / disable xdebug in a PHP docker container
#!/usr/bin/env bash
# see https://carstenwindler.de/php/enable-xdebug-on-demand-in-your-local-docker-environment/
if [ "$#" -ne 1 ]; then
SCRIPT_PATH=`basename "$0"`
echo "Usage: $SCRIPT_PATH enable|disable"
exit 1;
fi
# Expects service to be called app in docker-compose.yml