Skip to content

Instantly share code, notes, and snippets.

Avatar

Oliver Davies opdavies

View GitHub Profile
View example.txt
DOCKER_BUILDKIT=1 docker image build -f markdownlint.Dockerfile -t markdownlint .
docker run --rm \
-v $(pwd)/.markdownlint.yaml:/root/.markdownlint.yaml \
-v $(pwd)/source:/data \
markdownlint
View drupal-composer.Dockerfile
FROM php:8-cli-alpine AS base
FROM base AS console
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
WORKDIR /app
ENTRYPOINT ["/bin/sh"]
RUN apk add --no-cache \
git \
libpng-dev \
&& docker-php-ext-install \
View php.Dockerfile
FROM php:7.4-fpm-alpine AS base
ENV PATH=$PATH:/app/vendor/bin
WORKDIR /app
RUN apk add --no-cache \
libpng-dev \
mariadb-client \
&& docker-php-ext-install \
bcmath \
gd \
pdo_mysql
View ci.yml
name: CI
on:
pull_request:
branches:
- production
push:
branches:
- production
workflow_dispatch:
View station-facilities.html
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<script src="https://unpkg.com/petite-vue" defer init></script>
<div class="p-10">
<div class="max-w-4xl mx-auto p-4 bg-gray-100" v-scope="{
facilities: [
{ name: 'Toilets', available: false },
{ name: 'Parking', available: true },
{ name: 'ATM', available: false },
{ name: 'Ticket office', available: false },
@opdavies
opdavies / docker.md
Last active Apr 5, 2021
Docker resources
View docker.md

Books and video courses

YouTube videos

@opdavies
opdavies / Node.php
Last active May 11, 2020
Automatically updating the created date for talk nodes, to match the date of the latest event for that talk.
View Node.php
<?php
declare(strict_types=1);
namespace Drupal\custom\Entity;
use Drupal\node\Entity\Node as CoreNode;
use Drupal\paragraphs\ParagraphInterface;
use Illuminate\Support\Collection;
View rename-post-files.php
<?php
use Symfony\Component\Finder\Finder;
require_once __DIR__.'/vendor/autoload.php';
$finder = new Finder();
$files = $finder->in(__DIR__.'/source/_posts')->files();
/** @var \Symfony\Component\Finder\SplFileInfo $file */
View TodoistFilters.md

Dashboard: overdue, today, #inbox, @waiting

Focus: overdue, (p1 & today)

Morning Routines: (overdue|today) & ##Routines & p2

Morning:

View drupal_path_test.php
<?php
/**
* Tests Simple Smartling's path functionality.
*/
class SimpleSmartlingPathTest extends DrupalWebTestCase {
/**
* Implements getInfo().
*/