RegEx IP Address

$IPAddressRegEx = '^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$'

Test if CTRL SHIFT ALT is pressed

Documentação: - [clickData.func](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:func).qualifiers The string can contain any or all of the following: **shift, ctrl, alt, lwin, rwin**. If no qualifiers were down, the string will be: **none** - [Internal Command Modifiers](https://docs.dopus.com/doku.php?id=reference:command_reference:command_modifier_reference) | | | | ------------------------- | ---------------------------------------------------------------| | @keydown:\<qualifiers\> | test for a qualifier key or combination of keys | | @keydown:!\<qualifiers\> | test for a qualifier key or combination of keys NOT being down | | @keydown:any | tests if any qualifier keys are held down | | @keydown:none | instructions that are executed if no qualifiers are held down | | @keydown:common | common instructions that are always executed | ``` DOpus.Output('Iniciando script'); @keydown:common DOpus.Output('Executa independente de alguma tecla ter sido apertada ou não'); DOpus.Output('Útil quando você quer que o código execute sempre'); @keydown:none DOpus.Output('Só executa se nenhuma tecla esiver apertada'); @keydown:ctrl DOpus.Output('Só executa se CTRL tiver sido apertado'); @keydown:ctrlshift DOpus.Output('Só executa se CTRL e SHIFT tiverem sido apertados'); @keydown:any DOpus.Output('Executa se alguma tecla tiver sido apertada'); @keydown:!alt DOpus.Output('Só executa se ALT NÃO tiver sido apertado'); ```
var hKeys = clickData.func.qualifiers;

// If CTRL is pressed
if (hKeys.match(".*ctrl.*")){
    
}

// If SHIFT is pressed
if (hKeys.match(".*shift.*")){
    
}

// If ALT is pressed
if (hKeys.match(".*alt.*")){
    
}

Snippet que genera Tablas para la Documentación interna de MAT a partir de .csv

import pandas as pd
from tabulate import tabulate
import os as os

def csv_to_tabulate_table(file_path, file_name):
    # Load the CSV file into a Pandas DataFrame
    df = pd.read_csv(file_path)
    df = df.reset_index(drop=True)
    # Display the DataFrame
    #print(df.columns)

    table = tabulate(df, headers="keys", tablefmt="outline", showindex='never')

    # Display the Tabulate table
    #print(table)

    with open(f'output_txt/{file_name}.txt', 'w', encoding='utf-8') 

mount network drive

 sudo mount -t drvfs Y: /mnt/y/

popup = CustomPopup(titleName = titleName_ , infoSummary = infoSummary_ , infoDetail

# popup = CustomPopup(titleName = titleName_
#                             , infoSummary = infoSummary_
#                             , infoDetail = infoDetail_
#                             )


class CustomPopup(QDialog):
    def __init__(self
                 , titleName: str
                 , infoSummary: str, infoDetail: str
                 , parent = None):
        super(CustomPopup, self).__init__(parent)
        self.win = titleName + '_' + 'ui'
        # UIの window name (o

Lightbox for 'Panel Slider', 'Slideshow' and 'Overlay Slider' Yootheme Pro Element

Lightbox for 'Panel Slider', 'Slideshow' and 'Overlay Slider' Yootheme Pro Element
<!-- Yootheme Pro sliders with lightbox -->

<!--
1. For the 'Overlay Slider' or 'Panel Slider' Element:
-Add Link to the Image which has to be shown in the Lightbox
-Add element Attribute:
uk-lightbox="toggle: .uk-slider-items a"

2. For the 'SlideShow' Element:
-Add Link to the Image which has to be shown in the Lightbox
-Add element Attribute
uk-lightbox="toggle: .uk-slideshow-items a"
-->

<!-- OPTIONAL: -->
<!--
For the 'Overlay Slider' or 'Panel Slider' Element:

If link is set on Panel or

SVGアップロードを許可する

function add_file_types_to_uploads($file_types){
	$new_filetypes = array();
	$new_filetypes['svg'] = 'image/svg+xml';
	$file_types = array_merge($file_types, $new_filetypes);
	return $file_types;
}
add_action('upload_mimes', 'add_file_types_to_uploads');

popoverAPIサンプル

<button popovertaegrt="popover" popovertargetaction="show" class="popover-open">ポップオーバーを開く</button>
<div id="popover" popover class="popovertarget">
  <div>ポップオーバー</div>
  <button popovertaegrt="popover" popovertargetaction="hide" class="popover-close">ポップオーバーを閉じる</button>
</div>

文字列置換のいろいろ

import re

purePath = r'C:\Users\oki44\Documents\maya\projects\default'
filePath = re.sub(r'\\', '/', purePath) + '/'
fileName = 'fishSurf.xml'
importSkinWeight(filePath, fileName)


purePath = r'C:\Users\oki44\Documents\maya\projects\default'
filePath = purePath.replace("\\", "/") + '/'
fileName = 'fishSurf.xml'
importSkinWeight(filePath, fileName)

ChatGPT - JSON Mode

[**LINK TO RELEVANT DOCUMENTATION**](https://platform.openai.com/docs/guides/text-generation/json-mode)
"""
https://platform.openai.com/docs/guides/text-generation/json-mode
"""

import os

from dotenv import load_dotenv
from openai import OpenAI


# Instanciate and set the client
load_dotenv()
client = OpenAI(api_key = os.getenv("OPENAI_API_KEY"))

# Go by hand
completion = client.chat.completions.create(
  model = "gpt-3.5-turbo-0125",
  response_format = {"type": "json_object"},
  messages = [
    {"role": "system", "content": "You are a helpful assistant designed to output JSON."},
    {"role"

ChatGPT - Structured to Unstructured

"""
Example
Your accountant gives you a data sheet.
Your job is to write the quarterly earnings report!
"""

import json
import os

from dotenv import load_dotenv
from openai import OpenAI


# Instanciating and setting the client
load_dotenv
client = OpenAI(api_key = os.getenv("OPENAI_API_KEY"))


# Set the constant system prompt for the task
SYSTEM_PROMPT = "You are an assistant that writes concise, detailed, " +\
  "and factual quarterly earnings reports given structured data."
  
# Regular co

ChatGPT - Unstructured to Structured

import json
import os
from pprint import pprint

from dotenv import load_dotenv
from openai import OpenAI


# Instanciate and configure client
load_dotenv()
client = OpenAI(api_key = os.getenv("OPENAI_API_KEY"))

# Define the constant prompt for system
SYSTEM_PROMPT = "You are an assistant that returns only JSON " +\
  "objects with the resquested information."

# Usual functions
def complete(user_prompt):
  completion = client.chat.completions.create(
    model = "gpt-3.5-turbo",
    messages =

Show Dialog with Inputbox with default text highlighted

Documentação: [DOpus.Dlg](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:dialog) Eu tive que fazer a minha própria função porque a função GetString, que o Directory Opus fornece, não permite que o texto default do input box venha já selecionado/highlighted para você poder escrever outra coisa no lugar sem precisar selecionar o que estava escrito e apagar. The return value is the entered string, or an empty value if the dialog was cancelled. The index of the button selected by the user will be available via the result property once this method returns. The left-most button is index 1, the next button is index 2, and so on. If a dialog has more than one button then by definition the last (right-most) button is the "cancel" button and so this will return index 0. Onde usei: **_CLIPBOARD_Paste_Smart**
function askUser(strTitle, strMessage, strDefaultValue, strButtons, strIcon) {
	var dlg = clickData.func.Dlg;
	dlg.window = clickData.func.sourcetab;
	dlg.title = strTitle;
	dlg.message = strMessage;
	dlg.buttons = strButtons;
	dlg.icon = strIcon; // warning error info question
	dlg.max = 0; // Faz com que o dlg seja do tipo input box. Se colocar um número maior do que 0, limita a quantidade de caracteres que podem ser escritos.
	dlg.defvalue = strDefaultValue;
	dlg.select = true; // Fa

Get file extension

var strFile_name = 'C:\Windows\notepad.exe'
var strFileExtension = getFileExtension(strFile_name);

function getFileExtension(fileName) {
    // Mesmo que o nome do arquivo tenha vários pontos, pega apenas o último em diante
    // Cacher Setup 2.47.3.exe
    // retorna apenas .exe
	return /\.[^\.]+$/.test(fileName);
}

Test if file or path exists

Documentação: - [DOpus.FSUtil](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:fsutil).Exists (return bool) - verifica se o path existe. Path pode ser: - Absoluto: C:\\Windows - Absoluto: C:\\Windows\\ - Absoluto: C:\Windows\notepad.exe - Relativo: ..\\.. - Relativo: ..\\notepad.exe - URI: file:///C:/ - HTTP: http://www.microsoft.com - HTTPS: https://www.microsoft.com - FTP: ftp://ftp.microsoft.com - Windows Library: lib://Documents - EnvironmentVvariable: %USERPROFILE% - Directory Opus external control code: {sourcepath} - Directory Opus Collection: coll://Marked Pictures/Fotos Filhos - Directory Opus Alias: /mydocuments
if (DOpus.FSUtil.Exists(strPath)) {
	DOpus.Output('Existe o Path');
}

Resumo Hotstrings

Documentação Útil: - [Hotstrings](https://www.autohotkey.com/docs/v2/Hotstrings.htm) - [Send / SendRaw / SendInput / SendPlay / SendEvent](https://www.autohotkey.com/docs/v2/lib/Send.htm) **Opções:** - **\*** não precisa se Espaço, pontuação nem Enter para ativar o hotstring - **?** faz o hostring funcionar mesmo no meio de outra palavra - **b0** não apaga a abreviação **Caracteres especiais** | Caractere | Usar | | -----------|:-----| | { | {{} | | } | {}} | **Teclas** | Tecla | Usar | | -----------|:---------| | Enter | {Enter} | | Seta p/ Esquerda 3x | {Left 3} | | Backspace x2 | {bs 2} |
; Escreve um template de if e posiciona o cursor na condição, isto é, entre os parenteses.
:*:if\::if () {{}{Enter 2}{}}{Up 2}{End}{Left 3}


; "\ vira ""
:*b0:"\::""{Left}{bs 2}
; '\ vira ''
:*b0:'\::''{Left}{bs 2}
; % x2
:*b0:%%::{Left}
; ()
:?*b0:()::{Left}
; []
:?*b0:[]::{Left}
; {}
:?*b0:{}::{Left}
; && -> &  & 
:*:&&::&  & {Left 3}