Skip to content

Instantly share code, notes, and snippets.

View jasonsnider's full-sized avatar

Jason Snider jasonsnider

View GitHub Profile
@jasonsnider
jasonsnider / cloudSettings
Last active October 8, 2021 16:31
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-10-08T16:21:28.961Z","extensionVersion":"v3.4.3"}
@jasonsnider
jasonsnider / cmpsr.sh
Created August 19, 2021 13:46
Upgrade Composer from 1.x to 2.x on Ubuntu 20.04
#!/bin/bash
sudo apt remove composer
sudo apt update
sudo apt install curl
sudo curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/bin/composer
@jasonsnider
jasonsnider / h2
Created October 27, 2020 15:48
Enable HTTP/2 on Ubuntu 20.04 with Apache2 and PHP7.4
#!/bin/bash
sudo a2enmod http2
sudo a2dismod php7.4
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event proxy_fcgi setenvif
sudo apt install php7.4-fpm -y
sudo systemctl start php7.4-fpm
sudo systemctl enable php7.4-fpm
@jasonsnider
jasonsnider / uuid.sh
Created July 18, 2018 22:02
Change all varchar(36) to a char(36) - Assists with the migration from CakePHP v2 - v3
#!/bin/bash
DB_HOST='localhost'
DB_USER='root'
DB_PASS='password'
DB='default'
functionAlterTable(){
read a b c <<< "${ROW}"
echo "START QUERY: alter table $a modify $b char(36);"
@jasonsnider
jasonsnider / gulpfile.js
Created March 10, 2018 16:23
My Go To Gulp File
var gulp = require('gulp');
var watch = require('gulp-watch');
var cleanCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var merge = require('merge-stream');
var scss = require('gulp-scss');
function version(){
@jasonsnider
jasonsnider / build
Created December 5, 2013 14:41
The default script for The Parbake Project
#!/bin/sh
# Rebuilds The Parbake Project from it's git repositories
# Jason D Snider <jason@jasonsnider.com>
# Configure the build script
PROJECT_PATH="/var/www/parbake.org"
APACHE_PROCESS="www-data"
USER="jsnider"
GIT_ACCESS="git@github.com:"
@jasonsnider
jasonsnider / build-jsc
Last active December 30, 2015 08:59
The build script for jasonsnider.com
#!/bin/sh
# Rebuilds parbaked project from it's git repositories
# Jason D Snider <jason@jasonsnider.com>
# Configure the build script
PROJECT_PATH="/var/www/jasonsnider.com"
APACHE_PROCESS="www-data"
USER="jsnider"
GIT_ACCESS="git@github.com:"
@jasonsnider
jasonsnider / build
Last active December 19, 2015 15:59
This is the shell script I use for updating jasonsnider.com. I am building jasonsnider,com as three separate .git projects. Tinker (an MVC framework), Jsc (the jasonsnider.com plugin), JscTheme (the theme for jasonsnider.com). Rather than using submodules I'm treating each piece as it's own project. When new code gets pushed to the repository I …
#!/bin/sh
# Completely removes, rebuilds and reconfigures jasonsnider.com from it's git repositories
# Jason D Snider <jason@jasonsnider.com>
## Start by removing the entire website
rm -fR /var/www/jasonsnider.com/tinker
## Build the code base
cd /var/www/jasonsnider.com && git clone git@github.com:jasonsnider/tinker.git
#!/bin/bash
#=============================================================================
# The MIT License (http://www.opensource.org/licenses/mit-license.php)
# Copyright (c) 2010, Jason Snider <jsnider77@gmail.com>
#
# vhosts.sh - Assists in building new VirtualHosts
#
# Assists in quickly building local dev sites. Out of the box, this shouldn't
# be used in production, though with a little modification it can be suited
#!/bin/bash
#################################################################################################
# README
#
# Purges your dev DB and rebuilds it from source
#------------------------------------------------------------------------------------------------
# Usage
#
# ./dropTables.sh dbuser dbpass some_db /path/to/20100812123210.sql
#------------------------------------------------------------------------------------------------