Skip to content

Instantly share code, notes, and snippets.

View stewsnooze's full-sized avatar

Stewart Robinson stewsnooze

View GitHub Profile
//in dollartheme.theme where dollartheme is your theme name
function dollartheme_preprocess_node(array &$variables) {
$node = $variables['node'];
$variables['abs_url'] = $node->url('canonical', array(
'language' => $node->language(),
'absolute' => TRUE,
));
upstream jenkins {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
server_name myname.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
### Keybase proof
I hereby claim:
* I am stewsnooze on github.
* I am stewsnooze (https://keybase.io/stewsnooze) on keybase.
* I have a public key whose fingerprint is B021 BA64 252B C0A0 8EE4 ED29 3045 CC4F D5EA AD48
To claim this, I am signing this object:
@stewsnooze
stewsnooze / gist:1451329
Created December 9, 2011 12:21
Detecting errors in drush in Jenkins
YOURDRUSHCOMMAND 2>&1 |tee /tmp/test$BUILD_ID
if [ `grep -e "Fatal error" /tmp/test$BUILD_ID | wc -l` != 0 ]; then
ERROR_LEVEL=1
fi
.....
if [ `grep -e "^.* passes," /tmp/test$BUILD_ID | grep -v "0 fails" | wc -l` == 0 ]; then
echo "exited $ERROR_LEVEL" > /tmp/exit_code
exit $ERROR_LEVEL
else
exit 1
@stewsnooze
stewsnooze / myupdate.install
Created December 8, 2011 08:18
Adding a relevant content block in code
/**
* Update 6014: Set relevant content blocks active
*/
function ff_update_6014() {
$rc = array(
'video_nodes' => array(
'types' => array('video' => 'video'),
'vocabs' => array(
'1' => '1',
'limit' => 5,