Skip to content

Instantly share code, notes, and snippets.

Clicking away on my new Model M. It's a lovely sound.

Jay Williams jaywilliams

Clicking away on my new Model M. It's a lovely sound.
Block or report user

Report or block jaywilliams

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jaywilliams /
Last active Aug 14, 2019 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost (Updated - 2018)
#!/usr/bin/env bash
# Thanks to @samsonjs for the cleaned up version:
# Create Source Directory
mkdir -p $PREFIX/src
jaywilliams / .htaccess
Last active Jun 7, 2018
Magento 2 SSL Redirect Loop Fix (Apache + Varnish + Nginx)
View .htaccess
# Add this to your the Magento .htaccess file located in your docroot
## Nginx proxy HTTPS Fix for Magento
## Source:
SetEnvIf X-Forwarded-Proto https HTTPS=on
Vinai / or-example.php
Last active Oct 28, 2019
SearchCriteria OR Example for Magento 2
View or-example.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 / monolog.json
Last active Aug 21, 2019
lnav Monolog format
View monolog.json
"monolog": {
"title": "Monolog log file",
"description": "Monolog log format",
"url": "",
"regex": {
"default": {
"pattern": "\\[(?P<timestamp>.*)\\] (?P<logger>\\w+).(?P<level>\\w+): (?P<message>[^\\[\\{]+) (?P<context>[\\[\\{].*[\\]\\}]) (?P<extra>[\\[\\{].*[\\]\\}])"
Vestride /
Last active Nov 16, 2019
Encoding video for the web

Encoding Video


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 / deploy.rb
Last active Dec 18, 2016
Bedrock / Sage Capistrano Deploy
View deploy.rb
set :repo_url, ''
set :application, ''
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 / opcache.ini
Last active Mar 12, 2019
OpCache settings for Magento on PHP 5.5.14. Store this file as /etc/php.d/opcache.ini
View opcache.ini
; Enable Zend OPcache extension module
; Determines if Zend OPCache is enabled
; Determines if Zend OPCache is enabled for the CLI version of PHP
; The OPcache shared memory storage size.
denisnazarov /
Last active Oct 31, 2016
FFMPEG batch convert to h264 mp4 and webm
#! /bin/bash
# Based on Batch Convert Script originally by Beterhans
# Put all video files need to be converted in a folder!
# the name of files must not have " " Space!
# Rename the File if contain space
# Target dir
larrybotha / A.markdown
Last active Oct 7, 2019
Fix SVGs not scaling in IE9, IE10, and IE11
View A.markdown

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.

mwhite /
Last active Nov 8, 2019
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
You can’t perform that action at this time.