Skip to content

Instantly share code, notes, and snippets.

View rbrum's full-sized avatar

Richard Brum rbrum

View GitHub Profile
(function ($) {
/**
* jQuery extension: Add support for :tabbable and :focusable pseudo-classes
*/
$.extend($.expr[':'], {
data: $.expr.createPseudo
? // creating pseudo's supported?
$.expr.createPseudo(function(dataName) {
return function(elem) {
return !!$.data(elem, dataName);
@rbrum
rbrum / polls_export-import.sh
Created March 20, 2019 19:07
Polls Migration Commands (for AXO 3356)
#!/bin/bash
# Export all poll data, then re-import when done.
# NOTE: This is not meant to be run as a Bash script, as-is, but meant to be run one command at a time.
# STEP 1 - BEFORE ACQUIA DB PUSH:
# Export the relevant tables and their data to a .sql dump file
mysqldump cvshealthd8_dev poll poll__choice poll_choice poll_choice_field_data poll_field_data poll_vote > path/to/filename.sql
# STEP 2 - AFTER ACQUIA DB PUSH:
# Re-import the tables and data into the database after Acquia DB push
@rbrum
rbrum / views.view.fsu_feed_grid.yml
Created March 20, 2019 19:59
Split up FS&U: Grid Feeds
uuid: 1340f08d-b16f-4320-9f6e-37c1c9393bf7
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- node.type.article
- node.type.corporate_page
- node.type.external_resource
module:
@rbrum
rbrum / views.view.fsu_feed_list.yml
Created March 20, 2019 20:00
Split up FS&U: List Feed
uuid: 744cb57f-6d66-4de7-8df4-66edf8fa966a
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- node.type.article
- node.type.corporate_page
- node.type.custom_page
- node.type.external_resource
@rbrum
rbrum / eliminate_module.md
Created April 12, 2019 15:53
Eliminate Module

Run the following to get rid of a module if you changed the branch without first uninstalling the module properly:

drush eval '$module_data = \Drupal::config("core.extension")->get("module"); unset($module_data["MODULE_NAME"]); \Drupal::configFactory()->getEditable("core.extension")->set("module", $module_data)->save();'
@rbrum
rbrum / .bash_aliases
Last active July 19, 2019 18:32
Just some Bash aliases I've come up with (or stolen) over the years
# Like the old DOS `dir`
alias dir='ls -alp'
# Simple git aliases
alias gs='git status'
alias ga='git add'
alias gaa='git add .' # "git add all"
alias gr='git rm'
alias gx='git checkout -- $1' # discard changes to file
alias gd='git diff $1'