Skip to content

Instantly share code, notes, and snippets.

View nickopris's full-sized avatar

Nick Opris nickopris

  • Brussels, London
View GitHub Profile
@nickopris
nickopris / cf7-floating-labels-example-form.html
Created January 19, 2023 21:36 — forked from sagive/cf7-floating-labels-example-form.html
Contact Form 7 (CF7) Floating Labels.
<div class="newsletterSignUpFooter">
<div class="form-group">[text* your-name class:form-control class:input-lg] <label for="your-name">First Name</label></div>
<div class="form-group">[text* text-777 class:form-control class:input-lg] <label for="your-name">Last Name</label></div>
<div class="form-group">[email* your-email class:form-control class:input-lg] <label for="your-name">Your Email</label></div>
<div class="">[submit class:btn class:btn-warning class:btn-lg class:w100 "Send"]</div>
</div>
<?php
// Turn off all error reporting
error_reporting(0);
// Configuration
$user = 'your_login';
$password = 'you_password';
$host = 'imap.gmail.com';
@nickopris
nickopris / install.sh
Last active June 11, 2024 17:27
Development setup
# Prerequisites
# place this script in a directory called tools to sit at he same level as your project directory
# an .env file with credentials inside tools
# get the solr archive from prod or me. should be extracted into tools with the name solr_8.x_config
# Be aware that git pull and docker image pull are subjected to quota limits and may need to authenticate.
# script vars
PROJECT_DIRECTORY="your-project-new-folder"
MY_FORKED_REPO='https://github.com/...'
@nickopris
nickopris / FeatureContext.php
Created April 17, 2024 13:58
Behat get current user
<?php
declare(strict_types = 1);
use Drupal\DrupalExtension\Context\RawDrupalContext;
/**
* Defines step definitions that are generally useful for the project.
*/
class FeatureContext extends RawDrupalContext {
// in preprocessing.php
$variables['lead_form'] =
\Drupal::formBuilder()->getForm('Drupal\my_form_module\Form\LeadForm', 'hero_video');
//it passes that extra variable through getForm into an arguments array added on the end of buildForm
public function buildForm(array $form, FormStateInterface $form_state, string $gated_content_context = NULL) {
if($gated_content_context === 'hero_video') {