Skip to content

Instantly share code, notes, and snippets.

@mortenson
mortenson / ddrush.sh
Last active March 20, 2022 09:51
What I currently use for local Drupal/Tome dev
#! /bin/bash
# This runs a new Docker container, mounts the current directory (Drupal root),
# and runs an arbitrary drush command, in case you don't want to run it in dsession.
sudo docker run --rm -it --init -v "$(pwd)":/var/www/tome mortenson/tome drush "$@"
@PierreThiollent
PierreThiollent / Readme.md
Last active March 26, 2024 19:14
iTerm2 and Oh-my-zsh config

Setup iTerm2 and oh-my-zsh

Enjoy ! 😄

Install iTerm 2

Download iTerm2 here.

@tpiros
tpiros / robbyrussell.zsh-theme
Created November 1, 2019 10:39
Adding emojis to ZSH theme
# On a Mac: /Users/<username>/.oh-my-zsh/custom/themes
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
local emojis=("👋" "🤡" "🦄" "🤙" "🐼" "😊" "🔥" "⚡" "😎" "🌎")
local selectedEmoji=${emojis[$[1+($RANDOM%${#emojis[@]})]]}
local today=$(date +%m.%d)
# local ipCountry=`curl -s ip-api.com/json | python -c "import sys, json; print json.load(sys.stdin)['country']"`
# local country=$emoji_flags[${ipCountry}]
# }
case $today in
"01.01")
@jesugmz
jesugmz / Dockerfile
Last active October 23, 2021 21:25
Example how to build Docker multi-stage image using official PHP and Composer images
ARG PHP_VERSION=7.2-fpm-stretch
ARG COMPOSER_VERSION=latest
# builder stage
FROM php:$PHP_VERSION AS builder
ARG AMQP_VERSION=1.9.3
ARG PHPREDIS_VERSION=4.1.1
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests \
@nikathone
nikathone / UserResetLoginSubscriber.php
Created February 14, 2017 20:32
User reset login subscriber and redirect alter example.
<?php
namespace Drupal\wh_signup\EventSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
<?php
/**
* This plugin creates a new paragraph entity based on the source.
*
* @MigrateProcessPlugin(
* id = "mds_paragraph"
* )
*/
class ParagraphMigrateProcessor extends ParagraphProcessBase {
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm