Skip to content

Instantly share code, notes, and snippets.

View sanguis's full-sized avatar
👁️‍🗨️
DevOpsing all the things

Josh Beauregard sanguis

👁️‍🗨️
DevOpsing all the things
View GitHub Profile
@sanguis
sanguis / .gitconfig
Last active June 2, 2017 14:41
my .gitconfig file minus my name and email
[color]
ui = on
[core]
whitespace= fix,-indent-with-non-tab,-indent-with-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[alias]
df = !git diff --no-prefix && git diff --staged --no-prefix
clear = reset --hard
st = status
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
@sanguis
sanguis / .vimrc
Last active September 25, 2015 09:58
my vimrc file optimized fro drupal development
"general vim rc settings
set term=xterm-color
set smartcase " match 'word' case-insensitive and 'Word' case-sensitive
set showmatch " shows matching parenthesis, bracket, or brace
set showcmd " show commands while they're being typed
set incsearch " searches as you type
syntax on " syntax highlighing
set background=dark " adapt colors for background
:colorscheme desert
set vb t_vb=
@sanguis
sanguis / .profile
Created April 8, 2011 20:23
my mac bash profile file great for MAMP and git work.
complete -o default -o nospace -W "$(/usr/bin/env ruby -ne 'puts $_.split(/[,\s]+/)[1..-1].reject{|host| host.match(/\*|\?/)} if $_.match(/^\s*Host\s+/);' < $HOME/.ssh/config)" scp sftp ssh
export PATH=$PATH:/Applications/MAMP/Library/bin
export PATH=$PATH:/Applications/sshfs/bin
export PATH=$PATH:/home/josh/bin
export CLICOLOR=cons25
##
# Your previous /Users/joshbeauregard/.profile file was backed up as /Users/joshbeauregard/.profile.macports-saved_2011-01-26_at_16:11:54
##
alias.df !git diff --no-prefix && git diff --staged --no-prefix
alias.clear reset --hard
alias.st status
alias.lg log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
alias.co checkout
alias.con checkout -b
alias.ci commit
alias.br branch
alias.ls branch -a
@sanguis
sanguis / settings.php
Last active September 27, 2015 11:47
Common Drupal Developer environment settings.php vars
//if (module_exists("stage_file_proxy")) $conf['stage_file_proxy_origin'] = "http://www.url.com";
// Disable (page) caching
$conf['cache'] = 0;
// Output errors to screen (and log)
$conf['error_level'] = 1;
// Disable aggregation of js and css
$conf['preprocess_js'] = FALSE;
@sanguis
sanguis / gist:1621647
Created January 16, 2012 16:30
drupal 7 menu link with unquid #id funnction
<?php
function theme_menu_link($variables) {
$element = $variables['element'];
//changes
$element['#attributes']['id'] = 'mlink-' . $element['#original_link']['mlid'];
// standard output;
$sub_menu = '';
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
@sanguis
sanguis / gist:1754684
Created February 6, 2012 20:39
taxonomy_form_options($machine_name) Drupal 7
<?php
/**
* returns a array for use with #options in a form field
* */
function taxonomy_options_array($machine_name, $all = NULL) {
$v = taxonomy_vocabulary_machine_name_load($machine_name);
if (!empty($all)) {
$options[$all[0]] = $all[1];
}
@sanguis
sanguis / gist:2344800
Created April 9, 2012 17:13
feeds field mapping examples
<?php
/**
* Implements hook_feeds_processor_targets_alter().
*
* @see FeedsNodeProcessor::getMappingTargets().
*/
function foo_contact_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
$info = field_info_field($name);
if (in_array($info['type'], array('foo_fields_contact'))) {
@sanguis
sanguis / gist:2493155
Created April 25, 2012 20:37
search term and count
<?php
function search_tc_menu_alter(&$items) {
$items['search']['title callback'] = 'search_tc_title';
}
function search_tc_title($title) {
global $pager_total_items;
if ($pager_total_items[0] > 0) {
return t('!count search results for &#8220;!term&#8221;', array('!count' => $pager_total_items[0], '!term' => SEARCH_TERM));
@sanguis
sanguis / gist:2764624
Created May 21, 2012 20:55
tidy settings that I found work best for feeds_xpathparser
<?php
$tidyConfig = array(
'merge-divs' => FALSE,
'merge-spans' => FALSE,
'join-styles' => FALSE,
'drop-empty-paras' => TRUE,
'wrap' => 0,
'tidy-mark' => FALSE,
'escape-cdata' => TRUE,
'word-2000' => TRUE,