Skip to content

Instantly share code, notes, and snippets.

View ksenzee's full-sized avatar

Katherine Senzee ksenzee

View GitHub Profile
@ksenzee
ksenzee / mysite.module
Created March 1, 2018 23:40
How to keep Drupal paragraphs from "bleeding through" into languages where no translation exists - see https://www.mediacurrent.com/blog/deep-dive-translating-paragraphs
<?php
/**
* Implements hook_ENTITY_TYPE_access() for paragraph entities.
*/
function mysite_paragraph_access(\Drupal\paragraphs\Entity\Paragraph $entity, $operation, $account) {
// Show paragraphs only if they exist in the current language; don't fall
// back to the default language.
if ($operation == 'view') {
$current_language = \Drupal::languageManager()->getCurrentLanguage()->getId();
@ksenzee
ksenzee / grid_mixins.scss
Created December 8, 2017 22:49
Mixins that make it possible to use CSS Grid in IE 10/11 as well as in modern browsers. Based on mixins by Sascha Fuchs at https://medium.com/@gisugosu/css-grid-layout-spec-2-to-spec-1-transpiler-with-sass-415dff4dd31b.
/// Add Gap between the boxes
///
/// @author Sascha Fuchs
///
/// @group core - cssgrid
///
/// @param {list} $boxes - List with box sizes
/// @param {string} $gap - Optional column gap
@function box-gap($boxes, $gap) {
$box: ();
@ksenzee
ksenzee / .bash_aliases
Created February 24, 2016 20:11
Bash function to exclude files named *.info from a git diff.
git-diff-no-info ()
{
git diff `git status -s | grep -v ^\ D | grep -v info$ | cut -b4-`
}
function gi {
command=$@
git ${command:1}
}

Keybase proof

I hereby claim:

  • I am ksenzee on github.
  • I am ksenzee (https://keybase.io/ksenzee) on keybase.
  • I have a public key ASDZva8BOoc9MUWqWI-G_HFlk4vPAQjxOlfIbyetleThFgo

To claim this, I am signing this object:

Index: includes/themes/media_youtube.theme.inc
===================================================================
--- includes/themes/media_youtube.theme.inc (revision 40780)
+++ includes/themes/media_youtube.theme.inc (working copy)
@@ -22,6 +22,7 @@
$variables['fullscreen'] = isset($variables['fullscreen']) ? $variables['fullscreen'] : media_youtube_variable_get('fullscreen');
$variables['autoplay'] = $variables['autoplay'] ? 1 : 0;
$variables['fullscreen'] = $variables['fullscreen'] ? 'true' : 'false';
+ $variables['wmode'] = isset($variables['wmode']) ? $variables['wmode'] : media_youtube_variable_get('wmode');