Skip to content

Instantly share code, notes, and snippets.

function xdebug-status() {
if [ $# -eq 0 ]
then
if [[ "$XDEBUG_MODE" == "off" ]]
then
echo "Xdebug is off."
else
echo "Xdebug is on."
fi
else
#!/usr/bin/env bash
# Set the default message.
cat <<'EOF' | drush vset efd_default_message -
<p>As a result of the University's <a href="https://statements.cornell.edu/2020/20200310-coronavirus-update.cfm">recently announced proactive measures</a> to prevent the spread of the novel coronavirus disease, COVID-19, this event has been cancelled and we are not currently accepting applications.<br>For more information, please <a href="/about-ilr/contact-us">contact us</a>.</p>
EOF
# Here's an example of disabling a form using the default message.
echo '{default}' | drush vset efd__fex_wisp_sponsor_registration -
@jeffam
jeffam / 3005403-35__modified.patch
Last active December 2, 2019 23:54
Cannot delete or edit a block that is placed in a section of the layout_builder Patch for 8.7
diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
index 078d2adc80..ee7ffb426b 100644
--- a/core/themes/seven/seven.theme
+++ b/core/themes/seven/seven.theme
@@ -87,10 +87,11 @@ function seven_preprocess_block_content_add_list(&$variables) {
/**
* Implements hook_preprocess_block() for block content.
*
- * Disables contextual links for all blocks.
+ * Disables contextual links for all blocks except for layout builder blocks.
@jeffam
jeffam / readme.md
Last active February 26, 2019 13:44
ILR/CU Design System

ILR/CU Design System

  • Monorepo for components. Templates are twig, CSS preprocessor is Sass.
  • Each component is a package. Probably npm. Each package has its dependencies, compiled CSS, optional js, documentation, and twig template.
  • Projects can install components a-la-carte. e.g. npm install @cu-design/component-button.

An installed component might look like this:

node_modules/@cu-design/component-button/

macOS + php-fpm + apache

These are the notes for my PHP (mainly Drupal) development setup on macOS. I've tried Vagrant and Docker, and I sure wish they were worth it, but filesystem performace issues are too noticeable.

I prefer this native setup along with a robust development/staging server for catching any glitches from infrastructure differences.

Overview

  • PHP via [Homebrew][]
  • Apache 2.4.x (included with macOS)
@jeffam
jeffam / macos_pip_no-root.md
Created January 5, 2018 17:59
Installing PIP Packages in macOS without Root

I needed mkdocs installed but didn't want to do it as root, and virtualenv is overkill for my current needs. Here's what I did:

$ easy_install --help | grep -A 3 -- --user

This returned:

  --user                     install in user site-package
                             '/Users/jeff/Library/Python/2.7/lib/python/site-
 packages'

Keybase proof

I hereby claim:

  • I am jeffam on github.
  • I am jeffam (https://keybase.io/jeffam) on keybase.
  • I have a public key ASDyYm86GMAEEPfTAbmErxF3KTBP8ZdHI7TdDPL_v_X2ewo

To claim this, I am signing this object:

@jeffam
jeffam / README.md
Last active August 29, 2015 14:19
Drupal Branch Deployer for Task Train

Sample Per-branch Drupal Deployment Scripts for Task Train

This is some (rough) boilerplate code for automated deployments of feature branches in a Drupal project. It's kind of like a poor man's http://tugboat.qa/

Requirements:

@jeffam
jeffam / feeds_importer.inc
Last active August 29, 2015 14:19
Drupal Atom Feed w/ Media Importer
// Use with feeds-7.x-2.x-dev
// Tested with http://feeds.feedburner.com/TechCrunch/Greentech?format=xml
$feeds_importer = new stdClass();
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'atom_with_media';
$feeds_importer->config = array(
'name' => 'Atom Feed w/ Media',
'description' => '',
@jeffam
jeffam / sb_wsysiwyg_install.make
Last active August 29, 2015 14:18
sb_wysiwyg quick install
core = 7.x
api = 2
projects[sb_wysiwyg][type] = "module"
projects[sb_wysiwyg][download][type] = "git"
projects[sb_wysiwyg][download][url] = git://github.com/singlebrook/sb_wysiwyg.git
projects[sb_wysiwyg][download][branch] = "master"
projects[sb_wysiwyg][subdir] = "features"