Skip to content

Instantly share code, notes, and snippets.

James Sansbury q0rban

Block or report user

Report or block q0rban

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@q0rban
q0rban / Makefile.d7
Last active Mar 27, 2018
Example Tugboat Makefiles
View Makefile.d7
packages:
apt-get update
apt-get install -y mysql-client rsync
curl -L "https://github.com/drush-ops/drush/releases/download/8.1.15/drush.phar" > /usr/local/bin/drush
chmod +x /usr/local/bin/drush
drupalconfig:
cp /var/www/html/sites/default/tugboat.settings.php /var/www/html/sites/default/settings.local.php
createdb:
View mysql_splitdump.sh
#!/bin/bash
####
# Split MySQL dump SQL file into one file per table
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump
####
if [ $# -lt 1 ] ; then
echo "USAGE $0 DUMP_FILE [TABLE]"
exit
View uat-prod.diff
--- uat.txt 2016-04-12 17:27:28.000000000 -0400
+++ prod.txt 2016-04-12 17:26:35.000000000 -0400
@@ -19,7 +19,7 @@
[instance] => Array
(
[label] => Title
- [description] =>
+ [description] =>
[required] => 1
[settings] => Array
View uat-prod.diff
--- uat.txt 2016-04-12 16:28:41.000000000 -0400
+++ prod.txt 2016-04-12 16:28:59.000000000 -0400
@@ -1,24 +1,21 @@
- This node
+This node
Keyword: %node
%node:flag-cisco-add-to-calendar-count --> Add event to my calendar flag count
%node:flag-cisco-add-to-calendar-link --> Add event to my calendar flag link
-%node:field_address --> Address
%node:field-address --> Address
View -
--- uat.txt 2016-04-12 16:28:41.000000000 -0400
+++ prod.txt 2016-04-12 16:28:59.000000000 -0400
@@ -1,24 +1,21 @@
- This node
+This node
Keyword: %node
%node:flag-cisco-add-to-calendar-count --> Add event to my calendar flag count
%node:flag-cisco-add-to-calendar-link --> Add event to my calendar flag link
-%node:field_address --> Address
%node:field-address --> Address
@q0rban
q0rban / Makefile
Last active Mar 7, 2016
Example Project Makefile and shell scripts for use with Tugboat.
View Makefile
#
# Makefile for Project Foo
#
# Includes commands for Tugboat. Feel free to expand with custom project
# commands.
#
# This is called during "tugboat init", after all of the service containers have
# been built, and the git repo has been cloned. This can be used for things like
# installing additional libraries that don't come built-in to the tugboat
View INSTALL.md

Installation Instructions

First, copy the link to the raw git-drush.sh file.

# Download the file
$ wget [link-to-raw-git-drush.sh-file]

# Move it to a directory where you store binaries, such as ~/bin or /usr/local/bin:
$ mv git-drush.sh /usr/local/bin/git-drush
@q0rban
q0rban / module_enable.php
Created Oct 22, 2014
Enabling Drupal modules in an update hook
View module_enable.php
<?php
function hook_update_n() {
if (!drupal_check_module('foo')) {
throw new DrupalUpdateException('Foo does not have requirements needed to be enabled.');
}
module_enable(array('foo'));
return t('Enabled Foo module.');
}
View -
Started by lullajenky@chat.freenode.net on request of 'msnbcbot'
[EnvInject] - Loading node environment variables.
Building remotely on tugboat.lullabot.com in workspace /var/lib/jenkins/workspace/msnbc_pull_request_builder
Checkout:msnbc_pull_request_builder / /var/lib/jenkins/workspace/msnbc_pull_request_builder - hudson.remoting.Channel@2fcdf:tugboat.lullabot.com
Using strategy: Default
Last Built Revision: Revision bc5cf1c9fbe8c19625d87f9ca4cbe626222b1ab2 (origin/lullabot-publisher)
Cloning the remote Git repository
Cloning repository git@github.com:NBCUOTS/Publisher7_msnbc_core.git
git --version
git version 1.7.9.5
View -
if ($this->view->current_display == 'attachment_3') {
$counter += $this->view->query->pager->get_offset();
}
You can’t perform that action at this time.