Skip to content

Instantly share code, notes, and snippets.

View jaywilliams's full-sized avatar
🌱
Waiting for Spring to begin...

Jay Williams jaywilliams

🌱
Waiting for Spring to begin...
View GitHub Profile
@randallmlough
randallmlough / hugo-img-srcset.html
Last active May 8, 2021 12:31
A hugo img srcset partial that auto resizes images
<style>
img {
max-width: 100%;
}
</style>
<h1>Creating a srcset loop based on Resources</h1>
<!--
NOTE: This requires Hugo 0.32
@jaywilliams
jaywilliams / install-mosh.sh
Last active January 3, 2024 17:16 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost (Updated - 2024)
#!/usr/bin/env bash
set -e
# Dreamhost Mosh Install Script
# Jay Williams (https://gist.github.com/jaywilliams/c9ffab789b3f622abc932dd4cfaaeef5)
# Based on the gracious work of:
# Paul R Alexander (https://gist.github.com/palexander/2975305)
# Sami Samhuri https://gist.github.com/samsonjs/4076746
@soxofaan
soxofaan / README.md
Last active January 19, 2024 17:48
Simple pretty CSV and TSV file viewer.
@jaywilliams
jaywilliams / .htaccess
Last active June 7, 2018 16:09
Magento 2 SSL Redirect Loop Fix (Apache + Varnish + Nginx)
# Add this to your the Magento .htaccess file located in your docroot
############################################
## Nginx proxy HTTPS Fix for Magento
## Source: https://www.sonassi.com/blog/magento-kb/magento-https-redirect-loop-2
SetEnvIf X-Forwarded-Proto https HTTPS=on
@Vinai
Vinai / or-example.php
Last active September 28, 2021 20:48
SearchCriteria OR Example for Magento 2
<?php
declare(strict_types = 1);
namespace Training5\VendorRepository\Controller\Test;
use Magento\Catalog\Api\Data\ProductInterface;
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\Framework\Api\Filter;
use Magento\Framework\Api\FilterBuilder;
@skowron-line
skowron-line / monolog.json
Last active December 30, 2023 18:58
lnav Monolog format
{
"monolog": {
"title": "Monolog log file",
"description": "Monolog log format",
"url": "https://github.com/Seldaek/monolog",
"regex": {
"default": {
"pattern": "\\[(?P<timestamp>.*)\\] (?P<logger>\\w+).(?P<level>\\w+): (?P<message>[^\\[\\{]+) (?P<context>[\\[\\{].*[\\]\\}]) (?P<extra>[\\[\\{].*[\\]\\}])"
}
},
@Vestride
Vestride / encoding-video.md
Last active March 12, 2024 16:41
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@el-rotny
el-rotny / deploy.rb
Last active July 11, 2022 00:32
Bedrock / Sage Capistrano Deploy
set :repo_url, 'git@github.com:Design-Collective/some-repo.git'
set :application, 'the-app-name.com'
set :theme_name, 'sage'
# Branch options
# Prompts for the branch name (defaults to current branch)
#ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
# Hardcodes branch to always be master
# This could be overridden in a stage config file
@tegansnyder
tegansnyder / opcache.ini
Last active September 2, 2022 16:24
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
; Enable Zend OPcache extension module
zend_extension=opcache.so
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0
; The OPcache shared memory storage size.
@magnetikonline
magnetikonline / README.md
Last active November 27, 2023 21:12
Setting Nginx FastCGI response buffer sizes.