Skip to content

Instantly share code, notes, and snippets.

View troyxmccall's full-sized avatar

Troy McCall troyxmccall

View GitHub Profile
@troyxmccall
troyxmccall / firstmate.sh
Last active September 30, 2015 21:28
El Capitan Fixes/Bugs
# fix homebrew permissions first
sudo chown -R $(whoami):admin /usr/local
# update brew
brew update
# override el capitan's deprecated version of OpenSSL
brew install openssl
brew link openssl --overwrite
#fix ruby
brew uninstall ruby-build rbenv
brew install rbenv ruby-build
@troyxmccall
troyxmccall / vagrant2vb.sh
Created September 17, 2015 21:51
automate your IE vms as much as is humanly fucking possible
#!/bin/sh
# vagrant2vb.sh
#
# Made for use alongside the excellent ievms -
# https://github.com/xdissent/ievms
#
# Will export the local hosts (from /etc/hosts)
# to a batch script & add that batch script to a Windows VM
# The batch script will be executed to import the hosts onto the VM
# The batch file seems convoluted, until you only want to append the new hosts.
@troyxmccall
troyxmccall / gist:222594dcc95ba8f376ee
Last active August 29, 2015 14:22
centos 6.5 LAMP profile - linode set up
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm
yum update -y
yum remove mysql-libs
yum install httpd -y
yum install mysql55-server -y
yum install php54 php54-mysql php54-gd php54-mcrypt php54-devel php54-mbstring httpd-devel -y
<?php
// I have Groups. A group can have many discussions. A single discussion can have many posts.
// models/Group.php
public function delete()
{
// Check for discussions belonging to the group first
if ($this->discussions) {
foreach ($this->discussions as $discussion) {
$discussion->delete();
}

place this file in your project root

chmod +x updateprojects.sh

to make it executable, then run

sh updateprojects.sh

to update all your git projects

@troyxmccall
troyxmccall / pull-hook
Last active December 16, 2015 16:09
git hook for auto compiling compass after pull
#!/usr/bin/perl
use strict;
use warnings;
my ($previous_head, $current_head, $is_branch_checkout) = @ARGV;
my ($is_on_facelift, $run_compass) = 0;
if ($is_branch_checkout) {
$is_on_facelift = `git branch | grep -e "^\*.*facelift"`;
chomp $is_on_facelift;
@troyxmccall
troyxmccall / vhoster.pl
Last active December 12, 2015 07:19
create vhosts on the fly for nginx on vagrant //rename to shell (vhoster.sh)
# sudo ./vhoster.sh example.com
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
WEB_DIR='/vagrant'
SED=`which sed`
CURRENT_DIR=`dirname $0`
if [ -z $1 ]; then
echo "No domain name given"
@troyxmccall
troyxmccall / sublime-settings.conf
Created November 15, 2012 21:55
sublime user settings OSX
{
"bold_folder_labels": true,
"file_exclude_patterns":
[
".DS_Store",
"dump.rdb",
".git*"
],
"folder_exclude_patterns":
[
@troyxmccall
troyxmccall / gist:3913295
Created October 18, 2012 17:00
/etc/nginx/sites-available/default
server {
listen 80;
server_name lucid32.dev;
access_log /var/log/nginx/localhost.access.log;
## Default location
location / {
root /vagrant/yourprojectname;
index index.php;
}