Skip to content

Instantly share code, notes, and snippets.

View flocondetoile's full-sized avatar

Flocon de toile flocondetoile

View GitHub Profile
@xurizaemon
xurizaemon / .gitlab-ci.deploy.yml
Last active February 23, 2022 04:15
in answer to a "how do you deploy Drupal" tweet @ https://twitter.com/xurizaemon/status/1450908729122045955
# Based on https://gitlab.com/mog33/gitlab-ci-drupal/-/blob/3.x-dev/.gitlab-ci/ci/06_deploy.yml
#
# Basic docker image with ssh to be able to access a remote.
# Each access must add a ssh key, see samples below.
.deploy_ssh:
image: alpine:latest
needs:
- drush make
rules:
- if: '$CI_COMMIT_TAG != null'
@opi
opi / drupal_sticky_nav_with_debounce.md
Last active May 6, 2021 09:04
Drupal : Sticky navigation with debounce

In yourtheme.libraries.yml

global:
  js:
    dist/js/global.js: { minified: true }
  dependencies:
    - core/drupal
    - core/drupal.debounce
#!/bin/bash
function greenecho {
echo "" && echo -e "\e[30;48;5;82m ✔ $1 \e[0m"
}
function orangeecho {
echo "" && echo -e "\e[30;48;5;208m ⚠ $1 \e[0m"
}
# Get document root path
#!/bin/bash
function greenecho {
echo "" && echo -e "\e[30;48;5;82m ✔ $1 \e[0m"
}
function orangeecho {
echo "" && echo -e "\e[30;48;5;208m ⚠ $1 \e[0m"
}
# Get document root path
<?php
/**
* @When I switch to the frame by selector "[title=:arg1]"
*/
public function switchToIFrameFromSelector($iframeSelector) {
$function = <<<JS
(function(){var iframe = document.querySelector("$iframeSelector");iframe.name = "iframeToSwitchTo";})()
JS;
try {
@DuaelFr
DuaelFr / defcontent.sh
Last active July 25, 2018 14:36
Outputs the list of entity types and uuids contained by a content directory of a default_content module
#!/bin/bash
# How to use this script?
#
# 1. create an empty module that depends on default_content or reuse an
# existing one.
# 2. use `drush dcer --folder=path/to/module/content ENTITY_TYPE ID`
# to add default content to your module.
# 3. once all your content is in your module, clean up the content folder
# to only keep the content you need (ie. remove users most of the time).
@nikathone
nikathone / RecurringOrderManager.php
Last active November 21, 2019 22:15
Customization for revoking a subscription/Commerce recurring
<?php
namespace Drupal\custom_commerce_recurring;
use Drupal\commerce_order\Entity\OrderInterface;
use Drupal\commerce_recurring\RecurringOrderManager as BaseRecurringOrderManager;
use Drupal\commerce_recurring\RecurringOrderManagerInterface;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
@opi
opi / mailhog.md
Last active January 27, 2023 23:19
Install and configure MailHog (for Drupal) with a nice systemd unit and apache reverse proxy

MailHog (for Drupal) on Debian Stretch

MailHog is a nice mail testing tool for developers.

Website: https://github.com/mailhog/MailHog

Installation

Download the latest release on your local machine

@smockle
smockle / Flip.css
Created May 9, 2013 19:45
Flip demonstrates a flip animation using CSS. Tested in Google Chrome 26, IE 10, and Firefox Nightly.
/* entire container, keeps perspective */
body .flip-container {
width: 100%;
}
body .flip-container .flipper {
position: relative;
}
/* hide back of pane during swap */