Skip to content

Instantly share code, notes, and snippets.

View colorfield's full-sized avatar

Christophe Jossart colorfield

View GitHub Profile
const toggleMachine = new Machine({
id: 'toggleMachine',
initial: 'inactive',
states: {
inactive: {
on: {
TOGGLE: 'active'
}
},
active: {
@colorfield
colorfield / drupal-gatsby-next.md
Last active February 5, 2022 12:32
Drupal, Gatsby and Next

Drupal, Gatsby and Next

  • Gatsby and Next are both based on React.
  • No technical details here, just some personal opinions and resources
  1. Why not just Drupal Twig an jQuery
  2. When to use a Drupal backend
  3. When to use a Drupal frontend
  4. React and Vue
  5. Gatsby and Next
@colorfield
colorfield / better-drupal-dx-with(out)-docker.md
Last active March 30, 2021 10:53
A better Drupal DX with and without Docker

A better Drupal DX with and without Docker

Drupal local setup

Without Docker

drush serve FTW

Why?

@colorfield
colorfield / cypress-drupal.md
Last active February 10, 2021 09:40
Cypress

Cypress & Drupal

  • Introduction - webinar
  • Scope of Cypress - comparison with PHPUnit
  • Minimal setup - for local test and CI integration
  • Basic commands
  • PHPStorm integration
  • Documentation

Agile, BDD and Cypress intro

@colorfield
colorfield / standup.sh
Created October 8, 2020 19:54
Standup winner
#!/bin/bash
team=("Stephanie" "Dan" "Tish" "Alex" "Blazej" "John" "Mattia" "Christophe" "Maria" "Matt" "Gesche" "Lisa" "Dominic" "Nick" "Jamie" "Thomas" "Vasi" "Inky" "Chris" "Philipp" "Marco" "Beat")
suspense=("Picking" "🤔Changing" "😛Cheating")
RANDOM=$$$(date +%s)
# Get the winner
winner=${team[$RANDOM % ${#team[@]} ]}
# Produce some suspense
@colorfield
colorfield / multi-curl-test.php
Last active July 18, 2020 20:11
Testing performances of curl / curl_multi with php
<?php
/**
* @file Testing multiple curl / single curl.
*/
/**
* Multi curl.
*
* @param array $urls
@colorfield
colorfield / react_app.apache.conf
Created October 17, 2018 13:39
Virtualmin Apache reverse proxy vhost configuration for a React app, redirected to https by default
<VirtualHost *:80>
SuexecUserGroup "#1000" "#1000"
ServerName app.domain.com
ServerAlias www.app.domain.be
DocumentRoot /home/domain/public_html
ErrorLog /var/log/virtualmin/app.domain.com_error_log
CustomLog /var/log/virtualmin/app.domain.com_access_log combined
DirectoryIndex index.html index.htm
# Various rewrite rules.
<IfModule mod_rewrite.c>
@colorfield
colorfield / .lando.yml
Last active March 16, 2022 05:33
Drupal Lando configuration for Solr 8 and Search API
name: drupal-solr
recipe: drupal8
config:
# PHP 7 is required for Search API Solr > 2.
php: '7.4'
webroot: web
proxy:
search:
@colorfield
colorfield / .lando.yml
Last active October 16, 2022 06:58
Lando configuration for Drupal 8 with several databases, MailHog and PhpMyAdmin
name: drupal-8x
recipe: drupal8
config:
webroot: web
# Get nice URL's
proxy:
mailhog:
- mail.drupal8.lndo.site
pma:
- pma.drupal8.lndo.site
@colorfield
colorfield / ItineraryListPage.js
Last active January 16, 2018 21:44
React fetch on the component
import React from 'react';
import PropTypes from 'prop-types';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './ItineraryListPage.css';
import ItineraryTeaser from '../../components/ItineraryTeaser';
import ItineraryListHeader from '../../components/ItineraryListHeader';
import { JSON_API_URL } from '../../constants/env';
class ItineraryListPage extends React.Component {
static propTypes = {