Skip to content

Instantly share code, notes, and snippets.

View bryandugan's full-sized avatar

Bryan Dugan bryandugan

View GitHub Profile
@grumpysi
grumpysi / Install Imagemagick PHP 7.0
Last active January 28, 2020 13:58
Install Imagemagick on Laravel Homestead box Ubuntu 14 + PHP 7.0
sudo apt-get update && sudo apt-get install -y imagemagick php-imagick && sudo service php7.0-fpm restart && sudo service apache2 restart
@alexroper
alexroper / matrix-slideshow-example.twig
Created April 22, 2015 17:35
Slideshow with mixed matrix blocks in Craft CMS
{#
# Example of building a slideshow in Craft from adjacent matrix blocks.
#
# This is a technique for getting around the problem of not being able to nest
# matrix fields. Say you're using a matrix field for your 'article-body'
# that has rich-text fields, headings, photos with captions, and slideshows
# all mixed together as different blocks. The slideshow is created by just placing
# single slideshow images (with captions) next to each other in the matrix.
#
# For example:
@samhernandez
samhernandez / mysqlsync
Last active September 8, 2024 15:07
Sync remote mysql database to local over ssh
#!/bin/bash
# This script assumes you have ssh access to a remote server
# Both databases are backed up to sql files in the same directory
# this script is executed from.
# Usage:
# 1. Make sure this file is executable with `chmod +x mysqlsync`
# 2. Set the credentials for the variables at the top
# (Remember, no spaces around the '=' sign)
# 3. Run it from a directory where you'd like the backup files to go:
@siffring
siffring / .htaccess
Created March 4, 2012 17:33
htaccess to password protect a specific server
# ----------------------------------------------------------------------
# Password protect staging server
# Use one .htaccess file across multiple environments
# (e.g. local, dev, staging, production)
# but only password protect a specific environment.
# ----------------------------------------------------------------------
SetEnvIf Host staging.domain.com passreq
AuthType Basic
AuthName "Password Required"