Skip to content

Instantly share code, notes, and snippets.

View bkildow's full-sized avatar

Brian Kildow bkildow

View GitHub Profile
@adamzimmermann
adamzimmermann / migrate.sh
Last active June 27, 2024 12:37
Migration Script with Limit/Looping
#!/bin/bash
migrate_loop()
{
# Better readability with separation.
echo "========================";
# Get the output of the drush status.
drush_output=$(drush ms "$1" --format string);
# Split output string into an array.
@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');
@grayside
grayside / A Series of Useful Outrigger Docker Snippets
Last active February 15, 2018 21:12
Outrigger/Docker Shenanigans Outside a Project Configuration
The individual files in this gist each have a unique trick to offer. They may be moved to official documentation or individual gists at a future date.
This file is mostly added because gists insist on titling the page with the alphabetically first file name, instead of the gist title.
@jhedstrom
jhedstrom / notes.md
Created November 1, 2016 20:34
PHPUnit based tests in Drupal 8

Local setup

  • Environment variables:

    export SIMPLETEST_DB=mysql://user:pass@localhost/db_name
    export SIMPLETEST_BASE_URL=http://d8.dev
    
  • or copy core/phpunit.xml.dist to core/phpunit.xml and edit accordingly

@mmrko
mmrko / git-zsh-checkout-autocomplete-local-only.md
Last active July 20, 2023 08:48
List only local branches when autocompleting git checkout (Zsh)
git config --global alias.checkoutr checkout
$EDITOR /usr/local/share/zsh/site-functions/git-completion.bash

...and then modify the file as follows...

-__gitcomp_nl "$(__git_refs '' $track)"
+if [ "$command" = "checkoutr" ]; then
+    __gitcomp_nl "$(__git_refs '' $track)"
+else
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active March 13, 2025 07:34
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k