Skip to content

Instantly share code, notes, and snippets.

View grasmash's full-sized avatar

Matthew Grasmick grasmash

  • Annapolis Maryland, USA
  • 09:06 (UTC -04:00)
  • X @grasmash
View GitHub Profile
@mixin mobile-table {
margin: 0 0 2em 0;
display: block;
/* Force table to not be like tables anymore */
thead,
tbody,
th,
td,
@mixin mobile-table {
margin: 0 0 2em 0;
display: block;
/* Force table to not be like tables anymore */
thead,
tbody,
th,
td,
@grasmash
grasmash / mymodule.module.php
Created February 3, 2017 19:26
Dynamically swaps Drupal 8 menu item with a user's profile image.
<?php
// If you create a menu link titled "User Profile Image" with URL "/user",
// it will be dynamically swapped with the user's profile image.
/**
* Implements hook_link_alter().
*/
function mymodule_user_link_alter(&$variables) {
/**
* @var \Drupal\Core\Url
@grasmash
grasmash / BLT
Last active February 2, 2017 14:14
#!/usr/bin/env bash
[email protected]:acquia/buildsteps.git
branch=8.x
composer create-project acquia/blt-project:${branch}-dev blted8 --no-interaction
cd blted8
blt ci:pipelines:init
git co -b ${branch}
git add -A
<?php
/**
* Usage:
* php -f convert-to-drupal-org-packagist.php $(pwd)/composer.json
*/
$composer_json_filepath = $argv[1];
$composer_json = json_decode(file_get_contents($composer_json_filepath), TRUE);
#!/usr/bin/env bash
# Installs chromedriver on Ubuntu.
# Requires Trusty or higher.
# Scripts expect argument specifying bin dir.
BIN_DIR=$1
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
LATEST=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
wget http://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip
@grasmash
grasmash / travis-deploy.sh
Created December 15, 2015 21:38
Triggers a deployment when Travis performs a build on specified branch and test suite.
#!/usr/bin/env bash
# What does this script do?
# This script will watch for a specific Travis $build_job on a specific
# $source_branch on the canonical GitHub repository and deploy build artifacts
# to $dest_branch on the git.remote specified in project.yml.
# How to use this script?
# This script should be executed in the `after_success` section of .travis.yml.
# It requires three arguments. Example call:
@grasmash
grasmash / deploy.xml
Created December 15, 2015 21:34
Drupal 7 Deployment tasks
<project name="deploy" default="deploy:repo">
<target name="deploy:artifact" description="Builds separate artifact and pushes to git.remotes defined project.yml." depends="deploy:artifact:clean">
<!-- deploy.branch and deploy.commitMsg must be passed as params at runtime. -->
<if>
<or>
<not><isset property="deploy.branch"/></not>
<not><isset property="deploy.commitMsg"/></not>
</or>
# To authenticate your machine with Cloud API, use the `drush ac-api-login`
# command or download drush aliases from Acquia Cloud. This will save your
# credentials to ~/.acquia/cloudapi.conf.
# Next, use `buildsteps login` to authenticate with buildsteps.
# To execute build steps on an Acquia Cloud subscription:
variables:
script:
REPO_ROOT: /tmp/home/bolted8
# Perform the build.

Instructions

  1. Configure Local Machine
  • To authenticate your machine with Cloud API, use the drush ac-api-login command or download drush aliases from Acquia Cloud. This will save your credentials to ~/.acquia/cloudapi.conf.
  • Next, use buildsteps login to authenticate with buildsteps.
  1. Add a site to buildsteps via buildsteps add-site <site-name>
  • <site-name> is the machine name of your acquia subscription.
  1. Create .acquia.yml in your local project's root directory