Drupal, Typescript, Angular and Midjourney blog content, code snippets and tutorials.

Midjourney v5 Lighting Tips đź“š

Lighting is a crucial element of your prompt, as it significantly impacts the quality and mood of the image.

Midjourney v5 Theme Tips: How to Make Your Website Stand Out

In this blog post, we will take a look at some of the best themes that you can use on Midjourney v5.

Midjourney Camera & Film Type Tips

If you're looking to change the overall effect of your generated image, adding the following camera and film type keywords and styles to your prompt may help

Body types & Ethnicities in Midjourney

Discover various techniques to represent a wide range of characters in your writing. Combine these methods with appropriate language to develop the personas you have in mind.

Add an actions link with route and query parameters in Drupal 10

Actions links are links that appear in various places in the Drupal admin interface and allow users to perform common tasks. You can add your own custom actions links with route parameters and query parameters to make it easier for users to perform specific tasks in your Drupal site

how-to tips for using Midjourney to create aesthetic art

To create a specific aesthetic, you can reference different art movements, techniques, genres, media types, and more

Holding objects in Midjourney: a comprehensive guide

Are you struggling to generate the perfect image of a character holding a specific object? In this article, we'll explore tips on how to use Midjourney V5 to generate the perfect image of a character holding a handheld object.

Midjourney V5: What's new overview

Midjourney V5 has arrived, and it's packed with new features and improvements. In this article, we'll explore what's new in V5, compare it to previous versions, and showcase some sample prompts and outputs to demonstrate the evolution of image output quality.

Reference image usage in Midjourney guide

Utilizing images in your prompts to enhance the outcome In Midjourney v5, you can incorporate reference images as part of your prompt to influence the job's composition, style, and colors.

How to Use the Ternary Operator in Twig in Drupal 10

In Drupal 10, you can use the ternary operator in the same way as in regular Twig code. Here's an example of how you can use the ternary operator to create an array of CSS class names based on some conditions:

Drupal Behaviors: A How-To Guide to Javascript

Writing JavaScript code in Drupal can be challenging because of the way Drupal handles JavaScript. Drupal has a concept called "Drupal behaviors" that can help you write better JavaScript code that works consistently across your site.

How to include multiple content types in an entityQuery in Drupal 10

To include multiple content types in an entity query in Drupal 10, you can use the IN operator. The IN operator allows you to specify an array of content types to include in the query.

Midjourney v5 Camera Angles Control Tips

When working with Midjourney, you have the power to control the camera zoom and angle of your generated image. By adding specific phrases to your prompt, you can direct Midjourney to capture your subject in various ways.

Punctuation in Midjourney v5

If you're working with Midjourney, it's essential to understand how to use punctuation effectively. While the best recommendation is to use punctuation the way you learned in school, there are a few specific guidelines you should keep in mind when troubleshooting or resolving issues.

ts2322 error in Typescript explained

If you've been working with Typescript, you may have come across the ts2322 error. This error occurs when you try to assign a value of one type to a variable of another incompatible type.

The most common TypeScipt errors and mistakes

TypeScript can sometimes be tricky, with its unique features and strict typing rules causing a few bumps along the way. In this blog post, we'll explore some common TypeScript challenges.

Deploying a conainerized app with Docker

In this blog post, we'll take a hands-on approach to help you grasp the essentials of Docker development. We'll start with an overview of the process and then dive into a step-by-step guide. This post is relevant for developers, operations professionals, and anyone interested in DevOps.

What are Seeds in Generative AI?

A seed in generative AI is a starting point or initial input that is used to generate an output. Specifically, it is a value or set of values that is provided to the generative model to initiate the generation process

Creating automatic Node titles with custom Events in Drupal 10

Learn how to use custom events in Drupal 10 for creating automatic node titles. This step-by-step tutorial provides insights into content management and programmatically generating titles for specific content types.

Deployment identifier in Drupal explained

In Drupal, a deployment identifier (also known as deployment_identifier) is a configuration setting that can be added to your settings.php file. It is used to track configuration changes between different environments or deployments, such as from development to staging or production.

How to install Docker tutorial

In this blog post, we'll explore two options for setting up a Docker lab environment to help you get the most out of your learning experience: Docker Desktop and Play with Docker. These options are designed for a quick and easy setup, rather than aiming for production-ready, high-performance Docker cluster

How to use an existing image in your Midjourney Prompts

Here are some tips on how to use image prompts in Midjourneys

Get url path of referenced node image in Twig and Drupal 10

This snippet will definitely save you some time searching for the proper structure, it loops over entity referenced nodes and sets a background image from that node

Get url path of an entity reference in Twig in Drupal 10

This post gives you a snippet to get the URL path of an entity reference in Twig

All the Midjourney parameters explained (with examples)

In this post, we'll explore all of the Midjourney image generation parameters, including basic parameters like aspect ratio, chaos, quality, seed, stop, style, and stylize, as well as model version parameters and upscaler parameters.

Remove shortcut links with Drush in Drupal 10

During configuration imports, you can stumble upon this issue: not being able to import config because there are existing entities of type shortcut

Get page title inside of a paragraph in Drupal 10

I encountered this when I had to build a hero paragraph. I needed the page title inside my paragraph.

How to access custom block content field in Twig (Drupal 10)

I started using custom blocks for reusable content on a website. It turns out twig works a bit different on block content than on paragraphs.

How to set permissions to a route programmatically in Drupal 8, 9 or 10

Are you looking for a way to create custom permissions for your Drupal 8 module? Since Drupal 8, permissions are defined in a MODULENAME.permissions.yml file.

What is LoRa in image generation?

LoRA (Low-Rank Adaptation) is a mathematical technique used to reduce the number of parameters that need to be trained when fine-tuning Stable Diffusion models

A transform pipe to highlight and replace text in an Angular 13 template

I had this project where search results coming from an API service needed to be highlighted.

How does npm packages versioning work with caret and tilde

Something that can be interesting: how versioning for npm packages works?

How to save CSV data with Filesaver js in TypeScript

I had a web service giving me CSV results that needed to be downloaded in a TypeScript environment as a CSV file, here is how I did it

Programmatically saving a file in Drupal 8, 9 & 10

This tutorial code shares how to share a file entity programmatically in Drupal.

How to put a Drupal site in maintenance mode with drush

If you are running a devOps system, you can put your sites in maintenance mode like this:

The best ways to learn Drupal

Learn Drupal from basic to advanced level.

Drupal automatic updates is coming

Drupal automatic updates is a feature that will automatically install new Drupal core updates when they are released. This can be done without you having to lift a finger!

How to fix ReferenceError: exports is not defined TypeScript

If you are getting the error for code that runs in the browser, try defining a global exports variable above the script tags that load your JS files.

How to get items from local storage with TypeScript, manipulate and resave

an example of a print basket: how to get the items and re-save them

How to loop over field items in twig file in Drupal

If you want to use a looping functionality in x.html.twig​​​​​​​ you can use the following:

How to create an array of objects in Python

When learning new languages you always want to know the typical things like arrays, sorting, etc. Today I was messing around with some Python and noticed I had to look up how to create an array of objects.

Three ways to convert a string to number in TypeScript

Exactly like in JavaScript, you can use the parseInt or parseFloat functions, or simply use the unary + operator:

My thoughts on Github Copilot for Drupal development (screencast)

like many I tested out GitHub co-pilot and I specifically tested it out for drupal development now would this be useful as a drupal developer will this boost my productivity, in short, yes I would definitely say so

Set auto focus to ionic input in Ionic 6 and Angular 13

I stumbled upon setting focus to an element in Ionic. As it appeared, there is no directive to use (anymore) to autofocus an ionic input.

Accessing and setting values of field properties of entities in Drupal

Here are some ways to access field properties on entities in Drupal

EntityQuery access check will be enforced in Drupal 10

Until Drupal 9.2, if ::accessCheck() is not called then the query would default to checking access, i.e. behave as if ::accessCheck(TRUE) had been called.

How to add HTML to Drupal Messenger API service

Drupal now has a messenger service, powered by the class Drupal\Core\Messenger\Messenger. Here is how you can add HTML to the message

How to: cacheable JSON response in Drupal 8, 9 & 10

In my book Learning Drupal as a framework, we learn some nice things about cacheable dependencies. Recently I had to provide a JSON controller with cached data.

How to add direct share links to your Drupal page in page.html.twig

The following snippets can be used to get direct share links to Facebook, Twitter and LinkedIn in your page.html.twig

Get a link field url and value in Twig for both internal and external links

Drupal's link field is quite generic. You can both add internal paths as external links. Here is how get the correct values in twig.