This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
drush @yoursite.prod archive-dump | |
rsync -rvz -e 'ssh -p 1855' --progress --remove-sent-files [email protected]:/home/yourusername/drush-backups /Users/yourusername/Documents/Websites/backups/productionserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Altering the render array | |
function YOUR_THEME_preprocess_field(&$variables) { | |
//Giveaway node: field giveaway value | |
//change to dollar format | |
if ($variables['element']['#field_name'] == 'field_giveaway_value') { | |
$dollar_value = money_format('$%i', $variables['element']['#items'][0]['safe_value']) . "\n"; | |
$variables['items'][0]['#markup'] = $dollar_value; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _update_multi_registration($flag, $entity_id, $status) { | |
$entity_type = $flag->entity_type; | |
$entity = entity_load_single($entity_type, $entity_id); | |
$nodewrapper = entity_metadata_wrapper($entity_type, $entity); | |
$nodewrapper->field_event_mult_reg = $status; | |
$nodewrapper->save(true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Load up an array with variables you want to search through | |
$obj[] = $notification; | |
$obj[] = $invoice; | |
$obj[] = $user; | |
watchdog('module_name', 'Successfully Recieved Notification', array('@notification' => print_r($obj, 1)), WATCHDOG_NOTICE, 'link'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sportsmans_hub_omega_preprocess_node(&$variables) { | |
$variables['content']['field_giveaway_image'][0]['#item']['attributes']['class'] = 'logo'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT=' | |
$fg[cyan]%m: $fg[yellow]$(get_pwd)$(put_spacing)$(git_prompt_info) | |
$reset_color→ ' | |
function get_pwd() { | |
echo "${PWD/$HOME/~}" | |
} | |
function put_spacing() { | |
local git=$(git_prompt_info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#My aliases | |
alias ll="ls -la" | |
alias home="cd ~/" | |
alias websites="cd ~/Documents/Websites" | |
alias coda="/usr/local/bin/coda" | |
alias aurorawatch="bundle exec compass watch" | |
alias bashscripts="cd ~/Documents/Websites/bash_scripts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$vars['edit_reg'] = array( | |
'#type' => 'link', | |
'#href' => 'field-collection/field-event-instance/' . $registration_id . '/edit', | |
'#title' => 'Edit', | |
'#alt' => 'Edit registrations.', | |
'#attributes' => array( | |
'class' => 'button', | |
), | |
'#options' => array('query' => drupal_get_destination()), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function template_preprocess_entity(&$vars, $hook) { | |
// Add the View Mode class to the classes_array | |
if (isset($vars['elements']['#entity_view_mode']['view_mode'])) { | |
$view_mode = $vars['elements']['#entity_view_mode']['view_mode']; | |
$vars['classes_array'][] = 'view-mode-' . str_replace('_', '-', $view_mode); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin child-margin-fixer { | |
& > *:first-child, | |
& > *:last-child, | |
& > *:last-child > *:last-child, | |
& > *:last-child > *:last-child > *:last-child { | |
margin: 0; | |
} | |
} |
OlderNewer