Skip to content

Instantly share code, notes, and snippets.

View d0t15t's full-sized avatar

Isaac Bigsby Trogdon d0t15t

View GitHub Profile
@d0t15t
d0t15t / pre-commit
Created August 9, 2021 10:18 — forked from bserem/pre-commit
Run phpcs in ddev with Drupal standard on pre-commit.
#!/usr/bin/php
<?php
/**
* @file
* A Git pre-commit hook script to check files for PHP syntax errors and Drupal
* coding standards violations. Requires phpcs and Coder Sniffer:
*
* @see https://drupal.org/node/1419988
*
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
@d0t15t
d0t15t / youtube-url.php
Created January 24, 2017 18:11 — forked from simplethemes/youtube-url.php
Extracts YouTube video ID from various URL structures
<?php
$url = array (
'http://youtu.be/dQw4w9WgXcA',
'http://www.youtube.com/embed/dQw4w9WgXcB',
'http://www.youtube.com/watch?v=dQw4w9WgXcC',
'http://www.youtube.com/?v=dQw4w9WgXcD',
'http://www.youtube.com/v/dQw4w9WgXcE',
'http://www.youtube.com/e/dQw4w9WgXcF',
'http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcG',