Skip to content

Instantly share code, notes, and snippets.

View mindmergedesign's full-sized avatar

Juan Giraldo mindmergedesign

View GitHub Profile
@mindmergedesign
mindmergedesign / initiate_git_repo
Last active December 14, 2015 10:49
Initiate a repository
#Git configuration one time only
git config --global user.name "My Name"
git config --global user.email me@mydomain.com
git config --global color.ui true
cd my/project/folder
git init
git add .
git commit -a -m "initial setup of repository"
@mindmergedesign
mindmergedesign / drush_osx
Created March 7, 2013 19:17
Installing Drush on Mac OS X
How to install Drush on Mac OS X Mountain Lion.
1. Download the latest version of Drush to your local folder (e.g. Desktop)
2. Launch Terminal and change directory (where drush is downloaded)

cd ~/Desktop
3. Extract it.
4. Create /usr/local/lib if it does not exist (otherwise, skip this step)
sudo mkdir /usr/local/lib/
5. Move it to /usr/local/lib
sudo mv drush /usr/local/lib/
@mindmergedesign
mindmergedesign / drush_import_db
Created March 17, 2013 22:16
Import a database via Drush
$ drush sql-drop && drush sql-cli < backup_file_name.sql
@mindmergedesign
mindmergedesign / .gitignore-drupal
Last active December 15, 2015 06:49
Drupal gitignore template
# Sensitive information #
#########################
# Ignore configuration files that may contain sensitive information.
sites/*/settings*.php
# User Generated Content #
##########################
sites/*/files
sites/*/private
#!/bin/bash
if [ $(id -u) != 0 ]; then
printf "This script must be run as root.\n"
exit 1
fi
drupal_path=${1%/}
drupal_user=${2}
httpd_group="${3:-www-data}"
@mindmergedesign
mindmergedesign / omega_doctype
Created April 23, 2013 19:05
Omega Sub-Theme Doctype
/**
* Implements hook_preprocess_html().
**/
function YOURTHEMENAME_preprocess_html(&$vars) {
$vars['doctype'] = '<!DOCTYPE html>' . "\n";
$vars['rdf'] = new stdClass;
$vars['rdf']->version = '';
$vars['rdf']->namespaces = '';
$vars['rdf']->profile = '';
@mindmergedesign
mindmergedesign / remove_core_css
Created April 24, 2013 18:21
Remove Drupal core stylesheets with hook_css_alter
<?php
/**
* Remove Drupal's core system stylesheets.
*/
function THEMENAME_css_alter(&$css)
{
$path_system = drupal_get_path('module', 'system');
$remove = array(
$path_system . '/system.base.css',
@mindmergedesign
mindmergedesign / drush MAMP PRO
Last active December 16, 2015 20:09
Installing PHP PEAR PECL and DRUSH extensions on MAMP for Mac OS X 10.7 +
// We we need to add PHP's binaries to our path. The path is an environment variable that denotes which directories to look for commands in. The path can be modified by editing the ".profile" file under your home directory. I've used version 5.3.20 of PHP, but you can choose from whichever versions are available to you.
$ echo "export PATH=/Applications/MAMP/bin/php/php5.3.20/bin:$PATH" >> ~/.profile
//Now you can either restart your terminal session or run the following from your home directory to read in the new path variable.
$ . ./.profile
//You should now have the correct binaries on your path and can check this by running the "which" command again.
@mindmergedesign
mindmergedesign / gist:5600893
Created May 17, 2013 18:13
Find and remove .DS_Store files from repository
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
@mindmergedesign
mindmergedesign / git-reset
Last active December 17, 2015 16:09
Reset Git repo
git fetch origin
git reset --hard origin/master
git pull
git status