Skip to content

Instantly share code, notes, and snippets.

View davidneedham's full-sized avatar

David Needham davidneedham

View GitHub Profile
@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;
# }
@davidneedham
davidneedham / example.aliases.drushrc.php
Last active August 29, 2015 14:07
Example site alias file
<?php
// VARIABLES
// Where all of your local sites are located.
// [I'm using MAMP.]
$local_sites = '/Applications/MAMP/htdocs/';
// Where all of your remote sites are located.
// [This is usually where you land when you first SSH in.]
@davidneedham
davidneedham / .bash_profile
Created August 16, 2015 14:39
Domain Access Quickfix: a script to change the server domain access domains to your local domains
# Domain Access Quickfix
# Replace the domains with your own to change from the server to local.
# Created with help from http://www.amazeelabs.com/en/blog/drush-and-domain-access-module.
function da-quickfix() {
drush sqlq "UPDATE domain SET subdomain = 'SUBDOMAIN1.FOO.LOCAL' WHERE domain.subdomain = 'SUBDOMAIN1.FOO.COM' LIMIT 1 ;UPDATE domain SET subdomain = 'FOO.LOCAL' WHERE domain.subdomain = 'FOO.COM' LIMIT 1 ;"
drush vset --yes domain_root FOO.LOCAL
drush cc all
}
@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 / .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 (