This file contains hidden or 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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or 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 | |
/** | |
* Implements hook_block_view(). | |
*/ | |
function custom_block_view($delta) { | |
$function = 'custom_block_view_' . strtr($delta, '-', '_'); | |
module_load_include('inc', 'custom', 'custom.blocks'); | |
if (function_exists($function)) { | |
return $function(); |
This file contains hidden or 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
alias al='source ~/.bash_aliases' | |
alias ali='vi ~/.bash_aliases' | |
# Apache aliases | |
alias areload='sudo /etc/init.d/apache2 reload' | |
alias sar='sudo service apache2 reload' | |
alias sarr='sudo service apache2 restart' | |
# Chef aliases |
This file contains hidden or 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
## Run this script (with sudo) to install Chef & Chef Server on a Debian based system. | |
#!/bin/sh | |
## script to install Ruby prerequisites on Ubuntu so that Chef can be used to manage configuration. | |
## authored by Forest Mars for Elephant Ventures | |
## please run this script as a user with sudo | |
# First we'll add opscode as a trusted repository (and update again) | |
echo "deb http://apt.opscode.com/ precise-0.10 main" | sudo tee /etc/apt/sources.list.d/opscode.list |
This file contains hidden or 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
## Script to automatically pulldown all the files from any Pantheon environment to your local environment. | |
## To execute the script, copy the Pantheon download link onto your clipboard | |
#!/bin/bash | |
## Path to local developement environment is defined here: | |
declare siteroot= | |
echo "enter path to files tarball on s3" | |
read panfilepath |
This file contains hidden or 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
## This will create a file called my_db.sql with your most recent dump and keep a history of archived (& tagged) backups. | |
## NB: needs some error handling when sql connect fails (currently it returns the error, but continues script execution.) | |
#!/bin/sh | |
#declare siteroot=/home/engineer/archetypes | |
declare siteroot=/Applications/MAMP/htdocs/archetypes | |
declare budir=~/dbbackups | |
echo "tag?" | |
read tag |
This file contains hidden or 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 | |
/** | |
* @file | |
* Contains \Drupal\node\Plugin\Core\Condition\NodeType. | |
*/ | |
namespace Drupal\node\Plugin\Core\Condition; | |
use Drupal\condition\Plugin\ConditionPluginBase; |
This file contains hidden or 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
# Meta | |
alias al='source ~/.bash_aliases' | |
alias ali='vi ~/.bash_aliases' | |
# Git | |
alias gt='git' | |
alias gpm='git pull origin master' | |
alias gnb='git checkout -b' | |
alias gcm='git commit -m' | |
alias gaa='git add .' |
This file contains hidden or 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 newtheme_preprocess_page(&$vars, $hook) { | |
if (isset($vars['node'])) { | |
// If the node type is "blog" the template suggestion will be "page--blog.tpl.php". | |
$vars['theme_hook_suggestions'][] = 'page__'. str_replace('_', '--', $vars['node']->type); | |
} | |
} | |
// Add a single suggestion for nodes that have the "Promoted to front page" box checked. | |
function newtheme_preprocess_node(&$variables) { | |
if ($variables['promote']) { |
This file contains hidden or 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
$view = new view(); | |
$view->name = 'taxonomy_term'; | |
$view->description = 'A view to emulate Drupal core\'s handling of taxonomy/term.'; | |
$view->tag = 'default'; | |
$view->base_table = 'node'; | |
$view->human_name = 'Taxonomy term'; | |
$view->core = 7; | |
$view->api_version = '3.0'; | |
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ |
OlderNewer