Skip to content

Instantly share code, notes, and snippets.

Brandon Simpson brandonsimpson

Block or report user

Report or block brandonsimpson

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
@brandonsimpson
brandonsimpson / laravel-5-4-upgrade-laravel-mix-webpack.md
Created Apr 18, 2017
Laravel 5.4 - Upgrade from gulp to laravel-mix + webpack
View laravel-5-4-upgrade-laravel-mix-webpack.md
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
  
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
@brandonsimpson
brandonsimpson / vagrant-ubuntu-trusty64-mariadb-my.cnf
Created May 25, 2015
vagrant-ubuntu-trusty64-mariadb-my.cnf
View vagrant-ubuntu-trusty64-mariadb-my.cnf
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
user = mysql
@brandonsimpson
brandonsimpson / vhost1
Last active Aug 29, 2015
Nginx php5-fpm Symfony2 app server config
View vhost1
server {
listen 80;
server_name symfony.dev;
root /var/www/vhosts/symfony.dev/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@brandonsimpson
brandonsimpson / ubuntu-php5-fpm-phalcon.md
Last active Aug 14, 2016
Ubuntu 14.04 (Trusty) php5-fpm PhalconPHP install
View ubuntu-php5-fpm-phalcon.md

Ubuntu 14.04 (Trusty) php5-fpm PhalconPHP install

Optional - add repo for php 5.6.8

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
@brandonsimpson
brandonsimpson / nginx_timed_combined.md
Created Apr 23, 2015
Nginx multi-host combined access log format
View nginx_timed_combined.md

###Nginx multi-host combined access log format

Log multiple hosts with gzip compression and request time data.

From /etc/nginx/nginx.conf:

log_format timed_combined '$remote_addr - $remote_user [$time_local]  '
	'$host "$request" $status $body_bytes_sent '
	'"$http_referer" "$http_user_agent" "$gzip_ratio" ($request_time)';
@brandonsimpson
brandonsimpson / osx_cleardns_alias.md
Last active Aug 29, 2015
Flush and Reset All DNS Caches in OS X Yosemite
View osx_cleardns_alias.md

###Flush and Reset All DNS Caches in OS X Yosemite

Quickly clear all dns caches in OS X Yosemite with this bash alias.

  1. Edit your local ~/.bash_profile and add the following alias:
alias cleardns="sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches; sudo discoveryutil udnscachestats; sudo discoveryutil mdnscachestats;"
  1. Make sure to reload your bash profile (or restart your terminal):
@brandonsimpson
brandonsimpson / osx_uninstall_mysql_install_mariadb_homebrew.md
Last active Jul 5, 2019
OSX How To: Uninstall native MySQL and install MariaDB via Homebrew
View osx_uninstall_mysql_install_mariadb_homebrew.md

OSX How To: Uninstall native MySQL and install MariaDB via Homebrew

This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well, especially if you're used to managing MySQL installs via yum in linux.

First: Backup Your Data!

Backup all of your current databases with mysqldump

This isn't a tutorial on backups, and there are many ways to do it. You should know how to backup your data anyway. For this example, we'll do a full backup of our InnoDB databases.

@brandonsimpson
brandonsimpson / sync_mysql.sh
Created Jun 8, 2014
Quickly Dump + Backup + Sync MySQL tables between servers via command line
View sync_mysql.sh
#!/bin/bash
# sync mysql tables from dev server to production server quickly via command line
# specify the list of tables to sync below
dev_host="127.0.0.1"
dev_user="root"
dev_pass="K#oDAk6AF@GumR7"
dev_db_name="local_dev"
@brandonsimpson
brandonsimpson / py_git_updater.py
Created Jun 8, 2014
Python git auto pull for multiple development site virtual hosts
View py_git_updater.py
#!/usr/bin/env python
import os
import grp
import pwd
import subprocess
# update these settings to match your server settings
vhost_directory = '/home/' # cpanel uses /home - most linux servers use a variation of /var/www/vhosts
git_pull_command = 'git pull origin dev --quiet' # set to your preferred git pull command, and what branch to pull
show_all_output = True
@brandonsimpson
brandonsimpson / reinstall_git_brew.md
Last active Jul 3, 2019
Re-installing Git on Mac OSX with Brew
View reinstall_git_brew.md

Re-installing Git on Mac OSX with Brew

This is helpful if you've previously installed git from source on OSX, and other compilers can't find the correct path. You need to remove the current version of git, then re-install with brew.

Uninstall git if installed manually

  1. Check which git you're running:
    which git
    
You can’t perform that action at this time.