Skip to content

Instantly share code, notes, and snippets.

View EpocSquadron's full-sized avatar

Daniel S Poulin EpocSquadron

View GitHub Profile
@EpocSquadron
EpocSquadron / .gitconfig
Created April 5, 2013 16:10
My global git config
[core]
# Don't track permissions other than standard modes.
filemode = false
# Don't ignore File -> file changes.
ignorecase = false
# Vim is better.
editor = vim
[color]
ui = true
[help]
@EpocSquadron
EpocSquadron / .htaccess
Created April 2, 2013 21:03
ExpressionEngine index.php removing htaccess snippet.
# ##############################################################################
# # EXPRESSIONENGINE REWRITING #
# ##############################################################################
# Place this at the end of the file.
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
@EpocSquadron
EpocSquadron / new_gist_file
Created April 2, 2013 16:06
Install instructions for PHPCompatibility and PHPCodeSniffer on Ubuntu 12.10
Install dependencies
sudo apt-get install curl unzip
Install PHP Code Sniffer
sudo apt-get install php-codesniffer
Install PHP Compatibility
@EpocSquadron
EpocSquadron / config-overrides.php
Created March 28, 2013 16:26
Install scripts for brand new expressionengine builds. Run the pre script, then go through the form at the control panel url, then run the post script. Tested and functional on EE 2.4.0 - 2.5.5 unzipped archives.
$config['index_page'] = '';
$config['tmpl_file_basepath'] = $_SERVER['DOCUMENT_ROOT'].'/../templates/';
$config['third_party_path'] = $_SERVER['DOCUMENT_ROOT'].'/../third_party/';
$config['theme_folder_path'] = $_SERVER['DOCUMENT_ROOT'].'/themes/';
$config['theme_folder_url'] = ((isset(\$_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].'/themes/';
@EpocSquadron
EpocSquadron / .vimrc
Created February 6, 2013 20:33
Simple vimrc that i like.
" .vimrc
" See: http://vimdoc.sourceforge.net/htmldoc/options.html for details
" For multi-byte character support (CJK support, for example):
"set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,gb18030,latin1
set tabstop=4 " Number of spaces that a <Tab> in the file counts for.
set shiftwidth=4 " Number of spaces to use for each step of (auto)indent.
@EpocSquadron
EpocSquadron / Vagrantfile
Created November 21, 2012 21:42
A vagrantfile for a simple LAMP dev vm setup.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# IMPORTANT: Change these.
# What extension to use. Should be initials.dsdev.
server_extension = '.dev'
# What ip you want to reach the vm at.
host_only_ip = "192.168.33.10"
@EpocSquadron
EpocSquadron / git-deshitifer.sh
Created August 3, 2012 16:02
Remove files from a repo that should be ignored but you dont neccesarily want to delete from filesystem.
#!/bin/bash
# Regexes matching files and folders in the gitignore that should never be in a repo.
GITIGNORE_REGEXES=( ".+\.(diff|err|orig|log|rej|swo|swp|vi|sass-cache|sublime-project|sublime-workspace|komodoproject|esproj|espressostorage|rbc)" ".+\~" "\.\/\.(DS_Store|_.+|cache|project|settings|tmproj|komodotools|hg|svn|CVS|idea)" "\.\/(nbproject|Thumbs\.db|_notes|dwsync\.xml)" )
# Get rid of them in git, leave them in filesystem.
for REGEX in "${GITIGNORE_REGEXES[@]}"; do
FILES=`find -E . -iregex "$REGEX" | sed 's/^..//;' | tr '\n' ' '`
echo "## Regex: $REGEX"
if [ ! "$FILES" = "" ]; then
@EpocSquadron
EpocSquadron / perm.sh
Created August 3, 2012 14:12
ExpressionEngine Permissions File
#!/bin/bash
# Find location of this script.
# This ensures that only files in the directory in
# which this script exists (recursively) are modified.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set what the name of your expressionengine folders are.
SYSTEM="system"
IMAGES_DIR="public_html/images"
@EpocSquadron
EpocSquadron / gist:2936983
Last active October 6, 2015 04:37
Web Project Best Practices

Web Project Best Practices

Proper Gitignoring

When starting a project, or joining a project that hasn't done this yet, the first thing you should do is set up proper gitignore files. There should be a master gitignore in the project root based on the h5bp master gitignore, and a cache dir specific gitignore in each cache directory. Without proper gitignoring, junk files tend to find their way into commits and removing them becomes a pain, as everyone gets modified/removed conflicts forever after. The reasoning behind using a gitignore file for each cache folder separately instead of including path/to/cache_dir/* in the master gitignore is that git is inconsistent in whether the folder itself is actually stored in the remote git repo. It is most consistent to have gitignores ignoring all but themselves in each cache directory. Then that directory must always be in the remote repo in order to contain the .gitignore file.

@EpocSquadron
EpocSquadron / .txt
Created June 15, 2012 14:20
Better Gitignore for Web Projects (modified from h5bp)
# Numerous always-ignore extensions
*.bak
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi