Skip to content

Instantly share code, notes, and snippets.

Avatar

Jim Birch thejimbirch

View GitHub Profile
@thejimbirch
thejimbirch / git_submodule_fix.md
Created Jan 12, 2022 — forked from claraj/git_submodule_fix.md
Fixing git submodule AKA git repo inside another git repo
View git_submodule_fix.md

Problem, and symptoms:

You experience one or more of these symptoms

  • you have code in a directory but it's not being pushed to GitHub. You just see an empty directory icon
  • you see this message when you add code to your git repository from the command prompt
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
View teachforall.org_home_2021-09-10_12-11-59.json
This file has been truncated, but you can view the full file.
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4590.2 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
"benchmarkIndex": 1429.5,
"credits": {
"axe-core": "4.2.3"
}
@thejimbirch
thejimbirch / breadcrumb.html.twig
Created Apr 13, 2020
Add Schema.org BreadcrumbList inline in Drupal 8+ in your theme's templates.
View breadcrumb.html.twig
{#
/**
* @file
* Theme override for a breadcrumb trail.
*
* Available variables:
* - breadcrumb: Breadcrumb trail items.
*/
#}
{% if breadcrumb %}
@thejimbirch
thejimbirch / metatag_example.php
Created Aug 19, 2019 — forked from mortenson/metatag_example.php
OR statements in metatags...
View metatag_example.php
<?php
/**
* Implements hook_metatags_attachments_alter().
*
* This function allows you to define fallback tokens in case a field is empty.
*
* If all fallback values are empty, the tag will be empty.
*
* Example: [node:field_image:medium]||[node:field_legacy_image:medium]||/fallback.png
@thejimbirch
thejimbirch / contrib
Last active Jun 16, 2021 — forked from sean-e-dietrich/contrib
Contrib Command For Docksal
View contrib
#!/bin/bash
NAME=$1
VERSION=${2:-8.8.x}
if [[ -z "${NAME}" ]]; then
NAME=$(uuidgen)
fi
if [[ -d $NAME ]]; then
View pull_request_template.md

Description

As a developer, I need to start with a story.

A few sentences describing the overall goals of the pull request's commits. What is the current behavior of the app? What is the updated/expected behavior with this PR? Include your acceptance critiera! If your tasks were well-written, you can probably copy/paste some of this.

Affected URL

link_to_relevant_multidev_or_test_site

View schema-wp-add-new-type-claim-review.php
<?php //* do not include php tag
add_filter( 'schema_wp_types', 'schema_wp_new_add_schema_type_claim_review' );
/**
* Add ClaimReview to Schema Types options
*
* @since 1.0
*/
function schema_wp_new_add_schema_type_7623456( $options ) {
@thejimbirch
thejimbirch / paragraph--xeno-hero.html.twig
Created Apr 23, 2017
Partial section of Xeno Hero Drupal 8 Paragraphs Template
View paragraph--xeno-hero.html.twig
{# Prints div with classes, & content w/o img/invert/overlay/parallax fields. #}
<div{{ attributes.addClass(classes).setAttribute('data-overlay', overlay_levels).setAttribute('data-speed', parallax_speeds) }}>
{% if content.xeno_background_image|render %}
<div class="paragraph--type--xeno-hero__image">
{{ content.xeno_background_image }}
</div>
{% endif %}
{{ content|without('xeno_background_image', 'xeno_invert', 'xeno_overlay', 'xeno_parallax') }}
</div>
@thejimbirch
thejimbirch / Gruntfile-bootstrap-3.js
Last active Dec 16, 2019
Bootstrap 3 and 4 Gruntfiles with copy functions to move and rename files into a Drupal or Wordpress theme. Replace SITENAME with your site or theme name.
View Gruntfile-bootstrap-3.js
/*!
* Bootstrap's Gruntfile
* http://getbootstrap.com
* Copyright 2013-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
module.exports = function (grunt) {
'use strict';
@thejimbirch
thejimbirch / paragraph--carousel.html.twig
Created Oct 21, 2016
Drupal 8 Template for Bootstrap Paragraphs customized for Carousel.
View paragraph--carousel.html.twig