Skip to content

Instantly share code, notes, and snippets.

View colorfield's full-sized avatar

Christophe Jossart colorfield

View GitHub Profile
@colorfield
colorfield / AudioContentPage.css
Created May 30, 2017 17:45
AudioGuide demo - AudioContentPage React component
@import '../variables.css';
@import '../Page/Page.css';
@colorfield
colorfield / audio_list.fr-CA.md
Created May 30, 2017 17:55
AudioGuide demo - React audio_list route
title component
Liste Audio
ContentPage

Nodes Drupal

@colorfield
colorfield / index.js
Last active June 13, 2017 14:27
AudioGuide demo - React audio_page route
import React from 'react';
import { REST_HOST_NAME } from '../../constants';
import Layout from '../../components/Layout';
import AudioContentPage from '../../components/AudioContentPage';
export default {
path: '/audio/:id',
async action({ params }) {
@colorfield
colorfield / AudioContentList.js
Last active April 18, 2018 01:48
AudioGuide Demo - fetch componentDidMount
(...)
constructor() {
super();
this.state = {
audioList: { data: [] },
};
}
componentDidMount() {
@colorfield
colorfield / myhost.cfg
Created June 1, 2017 09:52
Nagios host configuration template
define host {
use linux-server
host_name vpsxxx.xx.xx # replace
alias vpsxxx # replace
address 127.0.0.1 # replace
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
}
@colorfield
colorfield / company.sql
Last active June 13, 2017 16:06
Company dummy data
CREATE TABLE `company` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`name` varchar(255),
`description` TEXT default NULL,
`phone` varchar(50) default NULL,
`email` varchar(89) default NULL,
`website` varchar(255) default "http://example.com",
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;
@colorfield
colorfield / stack.yml
Created November 18, 2017 09:29
Drupal with PostgreSQL, example provided by https://hub.docker.com/_/drupal/
# Drupal with PostgreSQL
#
# Access via "http://localhost:8080"
# (or "http://$(docker-machine ip):8080" if using docker-machine)
#
# During initial Drupal setup,
# Database type: PostgreSQL
# Database name: postgres
# Database username: postgres
# Database password: example
@colorfield
colorfield / index.js
Last active January 16, 2018 22:05
React fetch on the route
import React from 'react';
import Layout from '../../components/Layout';
import ItineraryListPage from './ItineraryListPage';
import { JSON_API_URL } from '../../constants/env';
const title = 'Audioguide';
async function action({ locale, fetch }) {
// Use Drupal locale (e.g. convert en-US to en).
const languageId = locale.substring(0, 2);
@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 = {
@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