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
jaywilliams / install-mosh.sh
Last active May 24, 2019 — forked from palexander/gist:2975305
Compiling and running mosh on Dreamhost (Updated - 2018)
View install-mosh.sh
#!/usr/bin/env bash
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME/local
VERSION=1.3.2
# Create Source Directory
mkdir -p $PREFIX/src
@jaywilliams
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: 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 Jun 12, 2019
SearchCriteria OR Example for Magento 2
View or-example.php
<?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 Jun 29, 2019
lnav Monolog format
View monolog.json
{
"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 Jul 21, 2019
Encoding video for the web
View encoding-video.md

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 Dec 18, 2016
Bedrock / Sage Capistrano Deploy
View deploy.rb
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 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
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.
@denisnazarov
denisnazarov / video_convert.sh
Last active Oct 31, 2016
FFMPEG batch convert to h264 mp4 and webm
View video_convert.sh
#! /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
indir=$1
@larrybotha
larrybotha / A.markdown
Last active Jul 15, 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
mwhite / git-aliases.md
Last active Jul 18, 2019
The Ultimate Git Alias Setup
View git-aliases.md

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.