Skip to content

Instantly share code, notes, and snippets.

View q0rban's full-sized avatar
👋

James Sansbury q0rban

👋
View GitHub Profile
@q0rban
q0rban / module_enable.php
Created October 22, 2014 00:10
Enabling Drupal modules in an update hook
<?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.');
}
@q0rban
q0rban / INSTALL.md
Last active August 29, 2015 14:25
git-drush

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 / Makefile
Last active March 7, 2016 14:24
Example Project Makefile and shell scripts for use with Tugboat.
#
# 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
@q0rban
q0rban / -
Created April 12, 2016 20:29
--- 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
--- 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
--- 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
#!/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
@q0rban
q0rban / Makefile.d7
Last active March 27, 2018 13:36
Example Tugboat Makefiles
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:
@q0rban
q0rban / config.yml
Last active February 19, 2020 19:25
Script to periodically create a new Tugboat Base Preview and an example circle
# An example CircleCI config.yml to periodically build a new Tugboat base preview.
version: 2
jobs:
rebuild-tugboat:
docker:
- image: circleci/node:10-stretch
steps:
- run:
name: Install Tugboat
command: |
@q0rban
q0rban / pipedrive.js
Created March 19, 2020 18:24
PipeDrive Fluid App Userscript
// PipeDrive Fluid App Activity Dock Badge.
// Authored by @q0rban
// 1. Set Patterns to *pipedrive.com*.
// 2. Paste this script.
// 3. Refresh your Fluid App.
// 4. If you still don't see badges, you might have to edit ~/Library/com.apple.ncprefs.plist
// and set flags for the app to "41,951,254". Then log out and log back in.
window.fluid.dockBadge = '';
// Set the dock badge after one second.