Skip to content

Instantly share code, notes, and snippets.

View davidneedham's full-sized avatar

David Needham davidneedham

View GitHub Profile
@davidneedham
davidneedham / .bash_profile
Last active April 5, 2016 19:23
David's aliases and tweaks to the command line that have saved him hours.
#!/bin/bash
#-------------------------------
# Local Development
#-------------------------------
function add_new_host () {
read -p "New local site name: " SITE
HOSTS='/etc/hosts'
SITEPATH='/Applications/MAMP/htdocs/'${SITE}
@davidneedham
davidneedham / .bash_profile
Last active December 20, 2015 20:48
A .bash_profile made specifically for use on DREAMHOST.
#-------------------------------
# GIT
#-------------------------------
# A 'better' git status information
alias gss='git status -s'
# Git add, commit with message, and push
alias gacp=git_add_all_commit_push
function git_add_all_commit_push () {
git add --all;
@davidneedham
davidneedham / ec.aliases.drushrc.php
Last active May 4, 2016 19:23
Drush Alias Wildcard for Enjoy Creativity server, allgoo.de.
<?php
/*
* Name: Drush Alias Wildcard
*
* Description: When working on Enjoy Creativity's server, you
* can always assume the connection information is the same,
* except for the project name. Once you set up your
* ~/.ssh/config to use the hostname for the project, this
* command will let you sync the database or files directory
* between local and dev.
@davidneedham
davidneedham / .bash_profile
Last active December 23, 2015 05:38
Git-dev-workflow bash scripts.
#-------------------------------
# GIT DEV WORKFLOW
#
# These commands all have to do with our development server on its.allgoo.de, which takes advantage
# of the excellent Git Dev Workflow by EOSREI (https://github.com/eosrei/git-dev-workflow). The first
# two commands assume that you have your .ssh/config file set up properly and the last command assumes
# that you have your custom Drush aliases file set up (https://gist.github.com/davidneedham/6301151).
#-------------------------------
# Generate the uli for a particular allgoo.de client site
function gdw-uli () {
@davidneedham
davidneedham / patches.txt
Last active December 26, 2015 00:09
sites/all/patches.txt This document is used to outline what patches have been applied to core, modules or themes on this website. For more information, please check out http://www.jenlampton.com/blog/sustainable-development-workflow-patching.
This document is used to outline what patches have been applied to core,
modules or themes on this website. For more information, please check out
http://www.jenlampton.com/blog/sustainable-development-workflow-patching.
Core patches:
===============
@davidneedham
davidneedham / config
Created November 20, 2013 21:19
~/.ssh/config
# This document will let you type "ssh example"
# and automatically load in the connection
# details. This saves a ton of time and is highly
# recommended. For more information check out
# http://linux.die.net/man/5/ssh_config
#################
# Other clients #
#################
Host example
@davidneedham
davidneedham / .my.cnf
Created November 20, 2013 21:57
~/.my.cnf This file is intended to be on your local computer and improve the efficiency with which you interact with mysql from the command line. This is safe being root/root locally using something like MAMP, but there could be security concerns on a server.
[mysql]
user=root
password=root
[mysqldump]
user=root
password=root
@davidneedham
davidneedham / gdw.settings.php
Created November 20, 2013 22:38
Put at your www root when syncing with a project that uses eosrei's Git-Dev-Workflow. This way you don't have to change database connection info when moving your code between the server and local.
<?php
/**
* A gdw.settings.php files for local D7 development. Store in /var/www.
*/
// Site is stored in '/var/www/example', so database name is 'example'
$database = basename(getcwd());
$databases = array (
'default' => array (
@davidneedham
davidneedham / Git notes
Last active August 29, 2015 14:01
Git notes
http://www.gitref.org
-----------------------------------------
Facts:
-----------------------------------------
Git makes it really easy to use version control for everything, not just project files. (ie. Aarons personal computer configuration settings.)
Commit IDs are hash's, commonly referred to by the first 4 or first 8 chars
There is a .git folder at the root of the repository, not within every subdirectory. However, you can still do commands within any subdirectory from root.
@davidneedham
davidneedham / .bash_profile (OLD)
Last active August 29, 2015 14:05
Old bash_profile code that I no longer use, but may still be helpful to reference
# THIS FILE IS OLD AND EXISTS AT THIS POINT FOR EDUCATIONAL PURPOSES ONLY.
# For the latest version, check https://gist.github.com/davidneedham/4014378.
# Refresh the local environment from dev
# ex: gdw-cc projectname dev
# function gdw-cc () {
# ssh -t "$1" gdw-drush "$2" cc all;
# }