---
title: Tips
url: 'https://www.twelvetone.tv/docs/technology-links/tips'
markdown: 'https://www.twelvetone.tv/docs/technology-links/tips.md'
date: '2026-09-25'
description: 'Useful tips for developers === Table of Contents Gradle Debugging Gradle Tasks From IntelliJ …'
taxonomy:
  category:
    - docs
---

[](#)  [ Home ](https://www.twelvetone.tv/docs/)     [ Technology Links ](https://www.twelvetone.tv/docs/technology-links)      Tips    

Useful tips for developers

===

#### Table of Contents

- [Gradle](#gradle)
    - [Debugging Gradle Tasks From IntelliJ](#debugging-gradle-tasks-fr)
- [Grav](#grav)
    - [Using a twig extension function in the plugin itself](#using-a-twig-extension-fu)
    - [Using a twig extension class](#using-a-twig-extension-cl)
    - [Routes](#routes)
- [OSGi](#osgi)
    - [Using the diag command to find missing references](#using-the-diag-command-to)
    - [Adding a command to Gogo](#adding-a-command-to-gogo)
- [Mocha / NPM](#mocha-npm)

# Gradle

## Debugging Gradle Tasks From IntelliJ

You need to make sure the task is not running in the Gradle daemon.

![](https://www.twelvetone.tv/docs/user/pages/07.technology-links/02.tips/breakpoints%20and%20gradle.png)

# Grav

## Using a twig extension function in the plugin itself

```php
public function onTwigExtensions()
{
    $this->grav['twig']->twig()->addFunction(
        new \Twig_SimpleFunction('forms', [$this, 'getForm'])
        );
    }
}

public function getForm($e)
{
}
```

## Using a twig extension class

```php
public function onTwigExtensions()
{
    require_once(__DIR__ . '/twig/twig-extensions.php');
    $this->grav['twig']->twig->addExtension(new GitTwigExtensions($this->grav));
}
```

## Routes

Grav routes always begin with `/`.

To referer to a route in a twig, always use `base_url ~ p.route`.

For edit page, it would be `base_url ~ '/admin/pages' ~ p.route`.

# OSGi

## Using the diag command to find missing references

![](https://www.twelvetone.tv/docs/user/pages/07.technology-links/02.tips/diag%20command.png)

## Adding a command to Gogo

```kotlin
@Component(service = [Command::class], property = ["osgi.command.scope=myscope", "osgi.command.function=doIt"])
class Command {
    fun doIt() {
    }
}
```

# Mocha / NPM

<https://mochajs.org/>

---

## Navigation

- Parent: [Technology Links](https://www.twelvetone.tv/docs/technology-links.md)
- Previous: [Pimple](https://www.twelvetone.tv/docs/technology-links/pimple.md)
- Children:
  - [Linux Tips](https://www.twelvetone.tv/docs/technology-links/tips/linux-tips.md)
  - [LVM](https://www.twelvetone.tv/docs/technology-links/tips/lvm.md)
  - [Zimbra Tips](https://www.twelvetone.tv/docs/technology-links/tips/zimbra.md)
  - [Vue](https://www.twelvetone.tv/docs/technology-links/tips/vue.md)
  - [Webpack Tutorial](https://www.twelvetone.tv/docs/technology-links/tips/webpack-tutorial.md)
  - [Rasberry Pi Tips](https://www.twelvetone.tv/docs/technology-links/tips/rasberry-pi-tips.md)
