Skip to content

Instantly share code, notes, and snippets.

View IT-Cru's full-sized avatar

Steffen Schlaer IT-Cru

View GitHub Profile
@geerlingguy
geerlingguy / drupal.yml
Last active January 19, 2024 02:15
Drupal in Kubernetes K3s on Raspberry Pi
# This manifest assumes 'drupal' namespace is already present:
#
# kubectl create namespace drupal
#
# Apply the manifest with:
#
# kubectl apply -f drupal.yml
---
kind: ConfigMap
apiVersion: v1
@a1ip
a1ip / youtube-video-thumbnails-sizes-and-formats.md
Created April 7, 2020 18:53
YouTube video thumbnails sizes and formats

Note: YouTube is serving thumbnails from 2 servers:

  • //img.youtube.com
  • //i.ytimg.com

Examples are with //i.ytimg.com server just because it’s shorter, no other particular reason. You can use both.

  • Player Background Thumbnail (480x360):

@matthewpalmer
matthewpalmer / pod.yaml
Created July 21, 2018 04:13
kubernetes nginx php-fpm pod
# Create a pod containing the PHP-FPM application (my-php-app)
# and nginx, each mounting the `shared-files` volume to their
# respective /var/www/html directories.
kind: Pod
apiVersion: v1
metadata:
name: phpfpm-nginx-example
spec:
volumes:
@bdlangton
bdlangton / Blocks.md
Last active October 12, 2023 08:40
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
@IT-Cru
IT-Cru / INREL-2145-robo-add_drush_nimbus_force_uuid_task.patch
Created May 24, 2017 08:42
Add nimbus-force-uuid drush command to burdamagazinorg/robo
diff --git a/Task/Drush/NimbusForceUuid.php b/Task/Drush/NimbusForceUuid.php
new file mode 100644
index 0000000..0e3fbe1
--- /dev/null
+++ b/Task/Drush/NimbusForceUuid.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace Thunder\Robo\Task\Drush;
+
@vasi
vasi / uuid.php
Last active November 11, 2021 15:23
Modify Drupal's config UUIDs to match a config dir
<?php
use Symfony\Component\Yaml\Yaml;
global $config_directories;
$config_name = drush_shift();
if (!isset($config_directories[$config_name])) {
print "No such config directory $config_name\n";
exit;
}
@vivianspencer
vivianspencer / gist:4b774f7150e675c81e4d3423d9c118d6
Created October 23, 2016 06:55
Drupal 8: Move taxonomy terms to another vocabulary
UPDATE taxonomy_term_data SET vid = 'NEW_TAXONOMY' WHERE vid = 'OLD_TAXONOMY';
UPDATE taxonomy_term_field_data SET vid = 'NEW_TAXONOMY' WHERE vid = 'OLD_TAXONOMY';
@slivero
slivero / gist:3164297
Created July 23, 2012 15:41
Resampling a JPEG image in PHP using GD (not imagemagick)
<?php
/**
* Class used for resampling images
*/
class Resampler
{
/**
* Resample an image
*