Skip to content

Instantly share code, notes, and snippets.

View jcicero518's full-sized avatar

Jeff Cicero jcicero518

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Web Components</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
margin: 0 auto;
@jcicero518
jcicero518 / nicaragua.module
Created July 10, 2023 22:08 — forked from dinarcon/nicaragua.module
Conditional fields in Paragraphs using the Javascript States API for Drupal 8
/**
* @file
* Example code from http://agaric.com/blogs/conditional-fields-paragraphs-using-javascript-states-api-drupal-8.
*/
/**
* Implements hook_field_widget_WIDGET_TYPE_form_alter().
*
* Example of conditional fields in paragraphs for Drupal 8.
*/
@jcicero518
jcicero518 / development.services.yml
Created February 7, 2023 21:43
settings.local.php
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
twig.config:
# Twig debugging:
#
# When debugging is enabled:
@jcicero518
jcicero518 / phpupdate.sh
Last active January 6, 2023 20:22
Changing current PHP version in Vagrant / Ubuntu
sudo update-alternatives --config php
There are 8 choices for the alternative php (providing /usr/bin/php).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/php8.1 81 auto mode
1 /usr/bin/php5.6 56 manual mode
2 /usr/bin/php7.0 70 manual mode
3 /usr/bin/php7.1 71 manual mode
@jcicero518
jcicero518 / tinglemodal.js
Created January 6, 2023 14:56
Tingle modal
import Tingle from 'tingle.js';
const modalTriggers = document.querySelectorAll('[data-micromodal-trigger="modal-search-popup"]');
const searchModal = new Tingle.modal({
footer: false,
stickyFooter: false,
closeMethods: ['overlay', 'button', 'escape'],
closeLabel: "Close"
});
@jcicero518
jcicero518 / page.html.twig
Created January 6, 2023 14:55
Vimeo video
<div class="vimeo-wrapper">
{# https://github.com/slightlyoff/lite-vimeo #}
{# <lite-vimeo videoid="689787743" autoload autoplay></lite-vimeo> #}
<iframe class="lazyload vimeo-video-frame" loading="lazy" src="https://player.vimeo.com/video/786287420?h=931ec44f97&background=1&autoplay=0&loop=0&byline=0&title=0"
frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
<div id="custom-newsletter-embed"></div>
<script src="https://url-for-newsletter-embed.js"></script>
@jcicero518
jcicero518 / index.html
Created December 19, 2022 22:55
flying-snow-2573
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>flying-snow-2573</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
@jcicero518
jcicero518 / index.html
Created December 19, 2022 22:54
flying-snow-2573
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>flying-snow-2573</title>
<link rel="stylesheet" href="styles.css">
<script type="application/dart" src="main.dart"></script>
</head>
function myModule_element_info_alter(&$type) {
if (isset($type['captcha'])) {
$type['captcha']['#after_build'][] = 'myModule_after_build_process';
}
}
function myModule_after_build_process($element, $form_state) {
$element['captcha_widgets']['recaptcha_widget']['#suffix'] = '<div><label class="hide" for="g-recaptcha-response">Recaptcha response</label></div>';
return $element;
}