Skip to content

Instantly share code, notes, and snippets.


Mike DeVita mikedevita

View GitHub Profile
DATE="$(date '+%s')"
MAJORVERSION="$(cat /etc/version | cut -d'-' -f2)"
MINORVERSION="$(cat /etc/version | cut -d'-' -f3 | cut -d ' ' -f1)"
if [ "$DELETEOLDFILES" = true ] ; then
mikedevita / AuthController.js
Created Oct 27, 2017
SailsJs + passport + passport-activedirectory - with ghaiklor/sails-generator-rest-api
View AuthController.js
"use strict";
* AuthController
* @description :: Server-side logic for manage users' authorization
const _ = require('lodash');
const passport = require('passport');

macOS 10.12 Sierra Setup

Custom recipe to get macOS 10.12 Sierra running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.11 El Capitan setup recipe and 10.10 Yosemite setup recipe. I am currently tweaking this for 10.12 Sierra and expect to refine this gist over the next few weeks.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. I generally reinstall each computer from scratch every 6 months, and I do not perform upgrades between releases.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your o

mikedevita /
Created Sep 16, 2017 — forked from bgallagh3r/
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
View spaceship.zsh-theme
# Spaceship ZSH Theme
# Author: Denys Dovhan,
# License: MIT
# ------------------------------------------------------------------------------
# The default configuration that can be overridden in .zshrc
View .zshrc
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
#export ZSH="/home/mike/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See
View .vimrc
"{{{Auto Commands
" Automatically cd into the directory that the file is in
autocmd BufEnter * execute "chdir ".escape(expand("%:p:h"), ' ')
" Remove any trailing whitespace that is in the file
autocmd BufRead,BufWrite * if ! &bin | silent! %s/\s\+$//ge | endif
" Restore cursor position to where it was before
augroup JumpCursorOnEdit