Skip to content

Instantly share code, notes, and snippets.

@yusufhm
yusufhm / .envrc
Last active Sep 28, 2022
podman setup
View .envrc
# Allows for builds using `docker-compose build`.
export COMPOSE_DOCKER_CLI_BUILD=0
@yusufhm
yusufhm / kube-commands.sh
Last active Sep 20, 2022
kube commands - kubernetes | kubectl | lagoon
View kube-commands.sh
# Tail logs of running build of a Lagoon project's environment.
kubectl -n env-ns logs -f --selector=lagoon.sh/jobType=build
View composer-local-directory-package.md

Add the following snippet to ~/.composer/config.json:

{
  "repositories": [
        {
            "type": "path",
            "url": "/path/to/package",
            "options": {
                "versions": {
 "owner/repo": "3.1.10"
@yusufhm
yusufhm / redis.sh
Last active Mar 1, 2022
redis commands
View redis.sh
# Get info.
redis-cli INFO
# DB size.
redis-cli DBSIZE
# Get real-time stats.
redis-cli --stat
# Monitor.
View gitlab-commands.md

Set env variables in Gitlab when pushing:

git push origin feature/ci-test  -o ci.variable="GOVCMS_CI_IMAGE_VERSION=:edge"
View dev-tools.md

Environment per project/directory

@yusufhm
yusufhm / drupal.yml
Created Feb 28, 2021
caprover app for Drupal
View drupal.yml
captainVersion: 4
services:
$$cap_appname-db:
image: bitnami/$$cap_db_type:$$cap_database_version
volumes:
- $$cap_appname-db-data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: $$cap_db_pass
MYSQL_DATABASE: drupal
@yusufhm
yusufhm / anonymous_author.html
Last active Jan 15, 2021
drupal.org module descriptions
View anonymous_author.html
<h3>Overview</h3>
Easily allow anonymous users to post content to your website by adding this field to any entity type. The most typical use-case of this module and the reason why it was initially created is for allowing the creation of forums by unauthenticated users, while requesting their name and email address, and whether they'd like to get notified.
<h3>Features</h3>
<ul>
<li>
Provides an Anonymous Author field type, containing the following values:
<ul>
<li>Name</li>
<li>Email</li>
@yusufhm
yusufhm / drupal-entity-updates.php
Last active Oct 2, 2020
Drupal entity updates
View drupal-entity-updates.php
<?php
/**
* Update an entity type's storage definition.
*
* An example is when the cardinality of a field is updated in config; since
* `drush updatedb` no longer performs entity updates, this has to be done
* manually now.
*/
function _MODULE_NAME_update_field_definition($entity_type_id, $field_name) {
@yusufhm
yusufhm / backup-bucket.json
Created May 20, 2020
s3 bucket policy for uploads
View backup-bucket.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListMultipartUploadParts"
],
"Resource": "arn:aws:s3:::*"
},