Skip to content

Instantly share code, notes, and snippets.

Avatar

Katherine Senzee ksenzee

View GitHub Profile
@ksenzee
ksenzee / mysite.module
Created Mar 1, 2018
How to keep Drupal paragraphs from "bleeding through" into languages where no translation exists - see https://www.mediacurrent.com/blog/deep-dive-translating-paragraphs
View mysite.module
<?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 Dec 8, 2017
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.
View grid_mixins.scss
/// 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 Feb 24, 2016
Bash function to exclude files named *.info from a git diff.
View .bash_aliases
git-diff-no-info ()
{
git diff `git status -s | grep -v ^\ D | grep -v info$ | cut -b4-`
}
View gist:b08520490ba917c8439e
function gi {
command=$@
git ${command:1}
}
View keybase.md

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:

View media_youtube-fix-embed-wmode.patch
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');