Get clipboard content

Documentação - [DOpus](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:dopus).GetClipFormat Returns a string indicating the native format of the clipboard contents. Optional flags: **c** Differentiate between cut and copied files Possible return values: **files** Files, if flags omitted or doesn't include c **files_copy** Files via Copy (Ctrl-C), if flags includes c **files_cut** Files via Cut (Ctrl-X), if flags includes c **image** Bitmap data **text** Text data **\<empty string\>** Empty clipboard, or any other type of data
// Check if the clipboard contains text
if (DOpus.GetClipFormat() == 'text') {
    // Save the clipboard text in a variable called ClipboardData
    var ClipboardData = DOpus.GetClip();
    //DOpus.Output(ClipboardData);
}

ChatGPT - System Prompts

Visit this link for further reference: https://github.com/mustvlad/ChatGPT-System-Prompts
# Imports and Settings
```python
import os

from dotenv import load_dotenv
from openai import OpenAI


load_dotenv()
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
```

# Define Convenience Functions for Completion and Printing
```python
def complete(user_prompt, system_prompt):
  completion = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[
      {"role": "system", "content": system_prompt},
      {"role": "user", "content": user_prompt}
    ]
  )

def print_respo

Test if a string is a valid URL

function isURL(str) {
	// Regular expression to match a URL
	var regex = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;

	// Test if the string matches the URL format
	return regex.test(str);
}

Test if a string is a valid file / folder path

function isWindowsPath(str) {
	// Regular expression to match a Windows path
	var regex = /^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$/;

	// Test if the string matches the Windows path format
	return regex.test(str);
}

Focus a file

Documentação: - [Select](https://docs.dopus.com/doku.php?id=reference:command_reference:internal_commands:select) Onde usei: **_CLIPBOARD_Paste_Smart** O Focus é o último arquivo (item) que o usuário clicou. Só pode haver 1 arquivo (item) com Focus. O arquivo (item) com Focus não necessariamente tem que estar como selecionado. Focus e Selected são coisas independentes. Se não colocar o argumento SETFOCUS, o directory opus irá selecionar o arquivo, mas manterá o Focus no arquivo (item) que tinha o Focus antes de executar o Select.
// Clear file selection
cmd.deselect = true; // Ensure the command deselects files
cmd.RunCommand('Select NONE');

// Select a file
// Set the item focus to the selected file
cmd.RunCommand('Select arquivo.txt SETFOCUS');

create nested json from html

$('#saveNewTasklist').on("click", function () {
    const nestedQuery = '.nested-sortable';
    const identifier = 'taskId';
    const root = document.getElementById('tasks');
    function serialize(tasks) {
        var serialized = [];
        var children = [].slice.call(tasks.children); // children == document property
        /**
         * [].slice.call() == Array.prototype.slice.call()
         * 
         * call slice() as if it was a function of NodeList using call(). What slic

JS plugin aka jQuery

class Test {
    constructor(el, options) {
        this.el = el;
        const defaultOptions = {
            onHover: (element, e) => {
                console.log(':)))', element, e);
            },
        };

        this.options = { ...defaultOptions, ...options };
        this.mouseOverHandler = this.handleMouseOver.bind(this); // Vytvoření odkazu na metodu handleMouseOver
    }

    init() {
        this.el.addEventListener('mouseover', this.mouseOverHandler); // Přidání po

jQuery $.data in vanilla js

/* 1 */
var item = document.getElementById("hi");
console.log(item);

item.data = {getType: function(){return this.TYPE},TYPE:"winner"};

var out = item.data.getType();
console.log("out", out);

var two = document.getElementById("hi")
console.log("should say 'winner': ", two.data.getType());



/* 2 */
window.$ = {
    data: function(obj, key, val) {
        if(!obj) {
            return this._data;
        } else if(!key) {
            if(!(obj in this._data)) {
                return {};
     

ODOO QWEB DEBUG

1 : Install IPDB (or PDB)

          pip3 install ipdb
          * WHEN RUNNING ODOO IN DOCKER CONTAINER, PUT THIS LINE TO DOCKER COMPOSE FILE UNDER ODOO CONTAINER DEFINITION
            command: --dev=qweb

2 : Add below code where you want to debug in xml

          t-debug="ipdb" or t-debug="pdb"

3. ATTACH TO RUNNING DCCKER CONTAINER BY FIRST GETTING CONTAINER ID WITH docker ps, THEN ATTACH docker attach container_id

4. RUN THE CODE WHERE XML FILE IS EXECUTED AND EXECUTION WILL PAUSE AT POS

Debug Gradle Task in Android Studio

# Debug Gradle Task in Android Studio

- Click the dropdown near the Run icon > Edit Configuration > (+) icon - Add New Configuration > Remote JVM Debug > leave everything as default > Add a name (Eg. GradleTaskDebug) > OK.
- Add breakpoint(s) to Gradle/Groovy/Kotlin DSL script.
- Append the following to Gradle command:
``` 
-Dorg.gradle.daemon=false -Dorg.gradle.debug=true

// Eg.
./gradlew publishToMavenLocal -Dorg.gradle.daemon=false -Dorg.gradle.debug=true
```
- Select the previous GradleTas

Create a file

Documentação: - [FSUtil](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:fsutil).OpenFile - usei para criar um novo arquivo e obter o handle dele. - [DOpus.Dlg](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:dialog).GetString - usei para solicitar um novo nome de arquivo para o usuário. Onde usei: **_CLIPBOARD_Paste_Smart** Este código tenta criar um novo arquivo com um nome padrão. Se o arquivo já existir, solicita para o usuário qual o novo nome a ser dado para o arquivo sendo criado. Entra em loop até que o nome do arquivo seja válido (não tenha nenhum arquivo com o nome informado). Aborta se o nome informado for em branco ou se clicar no botão Cancelar.
// Create a new File
var strFile_name = "Site"; // Nome default que quero dar para o arquivo.
var objFile = DOpus.FSUtil.OpenFile(clickData.func.sourcetab.path + "\\" + strFile_name + ".url", "wrcf");  // wr = read/write c=create (dá erro se já existir) f=force
// Se o arquivo já existir, pergunta para o usuário qual o novo nome que quer dar para o arquivo.
// Fica em loop enquanto não digitar um nome que não existe, ou até clicar em Cancelar ou clicar em OK com um nome em branco.
while (ob

Deselect all files

Documentação [Select](https://docs.dopus.com/doku.php?id=reference:command_reference:internal_commands:select)
// Clear file selection
cmd.deselect = true; // Ensure the command deselects files
cmd.RunCommand("Select NONE");

Laravel 11 with Boostrap 5


https://www.techiediaries.com/how-to-add-bootstrap-5-laravel-11/


Ubuntu 22.04 Runs Very Slow And The Solutions

### Solution 1. Upgrade your system

Apparently, upgrading the whole Ubuntu 22.04 system can fix the performance issue. By upgrade we mean updating all installed programs into their latest version, not updating the OS version. We did it and we can confirm Kubuntu works better and faster again after that. Please note that this will cost you time, money (for internet access) and a lot of disk space.

1. Disable all PPA.
2. Do repository refresh:
   `$ sudo apt-get update`
3. Do the first system-wi

Find Min Height Trees

/**
 * @param {number} n
 * @param {number[][]} edges
 * @return {number[]}
 */
var findMinHeightTrees = function(n, edges) {
    // Check if the graph is linear (a straight line)
    edges.sort((a, b) => a[0] - b[0]);
    let linear = true;
    for (let i = 0; i < edges.length - 1; i++) {
        if (edges[i][1] !== edges[i + 1][0]) {
            linear = false;
            break;
        }
    }

    // If the graph is linear, the root is the middle node(s)
    if (linear) {
        let x = Ma

Link2CSV

(()=>{const e=t=>{if(""!==t.id)return`id("${t.id.replace(/"/g,'""')}")`;if(t===document.body)return t.tagName.toLowerCase();let n=0;const o=t.parentNode.childNodes;for(let r=0;r<o.length;r++){const a=o[r];if(a===t)return`${e(t.parentNode)}/${t.tagName.toLowerCase()}[${n+1}]`;1===a.nodeType&&a.tagName===t.tagName&&n++}},t=e=>`"${e.replace(/"/g,'""')}"`,n=document.querySelectorAll("a"),o=[];n.forEach((n=>{const r=t(n.href),a=(e=>{const t={internal:new RegExp(`^https?://${location.host}`,"i"),exter