Skip to content

Instantly share code, notes, and snippets.

@swalkinshaw
swalkinshaw / application.php
Created November 17, 2019 17:29
Trellis + Sentry
<?php
/**
* composer require sentry/sentry-sdk
*/
use Sentry;
Env::init();
// Bedrock application config...
if (env('SENTRY_DSN')) {
Sentry\init([
'dsn' => env('SENTRY_DSN'),
@Log1x
Log1x / application.php
Last active April 3, 2020 20:38 — forked from swalkinshaw/application.php
Trellis + Sentry
<?php
/**
* composer require sentry/sentry-sdk
*/
Env::init();
// ...
if (env('SENTRY_DSN') && env('WP_ENV') !== 'development') {
@mindfullsilence
mindfullsilence / README.md
Last active February 12, 2024 20:50
Root Bedrock Homestead site-type

This script will create a roots/bedrock project in your desired directory, install composer dependencies, and install wordpress via the wp-cli tool. Works with mailhog.

For global homestead installations (not per-project installs)

Place the sh file in Homestead/scripts/site-types/

In your Homestead.yaml file, use "bedrock" as the type key for a site mapping, and the value of the map key as the database. Be sure to add /web to the end of your to: key for your folder mapping. The script will generate the web folder for you. E.g.:

---
@LukaGiorgadze
LukaGiorgadze / EllipticCurve.go
Last active May 31, 2024 12:10
Golang ECDSA (Elliptic Curve Digital Signature Algorithm) example, generate Private/Public key pairs, verify and test
package ec
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/md5"
"crypto/rand"
"crypto/x509"
"encoding/pem"
"errors"
@strarsis
strarsis / guide.md
Last active February 19, 2023 00:29
Object caching with Bedrock (and Trellis) using Redis

Object caching with Bedrock (and Trellis) using Redis

What is object caching

While nginx microcaching already solves page caching (as of static, rarely changing WordPress pages), the performance for dynamically generated pages (like WooCommerce shop pages and admin backend in general) can benefit greatly from additionally using an object cache. Object caching allows an application (in this case WordPress with its plugins, theme, etc.) to store prepared objects (mostly database queries) in a database and quickly retrieve them, therefore improving the performance of dynamic page generation. Object caching is (usually) transparent, which means that it shouldn't be noticeable by users and developers (except for the performance improvements of course).

Implementations

@hhhonzik
hhhonzik / deploy.yml
Last active April 22, 2024 10:30
Kinsta Deployment
# Kinsta Deployment through Github Actions for Bedrock/Sage.
#
# Placed at: .github/workflow/deploy.yml
#
# Process should be studied from code, but some quick brief:
# - runs composer / sage installation
# - moves correct `.env.*` file for multiple configs
# - uses rsync to sync files, uses /.rsyncignore file to exclude whatever should not be there
# - symlinks uploads folder and symlink release folder to kinsta public hostname
# - if you want to clear cache, please uncomment the last job