Skip to content

Instantly share code, notes, and snippets.

View zakiya's full-sized avatar

zakiya zakiya

View GitHub Profile
import csv
import gzip
import io
import json
import os
import sys
import time
import urllib.error
import urllib.request
name Proposal
about Design system 01 - Propose a design system project or component
title Proposal:
labels Process - New Component, Process - Proposal
assignees

Thanks for reaching out with your proposal for the Design System. Our design system team will review this component proposal as soon as we can.

@zakiya
zakiya / check_paragraph_usage.php
Last active February 2, 2021 00:34
Get a list of entities that reference a paragraph type.
_field_usage_check('event', 'entity_reference');
/**
* string $reference_type
* Example: 'node' or 'paragraph'
* string $referenced_entity_type
* Example: 'entity_reference' or 'entity_reference_revisions'
*
* Given the machine name of a paragraph, return/print the entities that reference it.
*/
<?php>
function myfunction($app) {
// ~~ Core.
// debug($app);
// dump($app);
// var_dump($app);
// ~~ Devel + kint library + settings
// dpr($app);
// kint($app);
@zakiya
zakiya / debug.twig
Created January 15, 2021 19:49
Debugging Twig in Drupal
{# ~ Core ~ #}
{# {{ dump() }} #}
{# {{ dump(page) }} #}
{# ~ Devel~ #}
{# {{ kint()}} #}
{# {{ kint(page)}} #}
{# {{ devel_dump(page) }} #}
{# {{ devel_breakpoint() }} #}
@zakiya
zakiya / localupdater.sh
Created September 9, 2020 01:02
Update local
#!/bin/bash
COLOR_RED="\033[0;31m"
COLOR_YELLOW="\033[0;33m"
COLOR_GREEN="\033[0;32m"
COLOR_OCHRE="\033[38;5;95m"
COLOR_BLUE="\033[0;34m"
COLOR_WHITE="\033[0;37m"
COLOR_RESET="\033[0m"
# To set a crontab for this script:
@zakiya
zakiya / contacts.js
Created April 20, 2020 18:53
Limit exposed filter options.
(function($, Drupal) {
'use strict';
Drupal.behaviors.viewContactContacts = {
attach: function(context, drupalSettings) {
// List of tids from pacificsource_preprocess_views_view__contact_contacts().
const $tids = drupalSettings.pacificsource.view_contact_contacts.contact_tids;
// Target the correct view.
@zakiya
zakiya / submit-scroll.js
Created January 28, 2020 18:46
Scroll to position of submit button so users can see the new content that's displayed below.
(function($, Drupal) {
"use strict";
Drupal.behaviors.submitscroll = {
attach: function(context) {
// Define button.
const $submitButton = $(".jcc-choice-section input[type=submit]");
// Send offset values to sessionStorage, then submit form.
$submitButton.click(function(e) {
#!/usr/bin/env bash
COLOR_RED="\033[0;31m"
COLOR_YELLOW="\033[0;33m"
COLOR_GREEN="\033[0;32m"
COLOR_OCHRE="\033[38;5;95m"
COLOR_BLUE="\033[0;34m"
COLOR_WHITE="\033[0;37m"
COLOR_RESET="\033[0m"
# function git_color {
<div> New Header! </div>