Parallax Element

credit: https://gomakethings.com/how-to-test-if-an-element-is-in-the-viewport-with-vanilla-javascript/
function isInViewport(elem) {
   var bounding = elem.getBoundingClientRect();
   // console.log('bounding', bounding);

   if (
      bounding.top >= 0 &&
      bounding.left >= 0 &&
      bounding.right <= (window.innerWidth || document.documentElement.clientWidth) &&
      bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight)
      
   ) {
      console.log('is in viewport');
      return true;
   } else {
      console.log('not in viewport');
      re

2965. Find Missing and Repeated Values

You are given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n2]. Each integer appears exactly once except a which appears twice and b which is missing. The task is to find the repeating and missing numbers a and b. Return a 0-indexed integer array ans of size 2 where ans[0] equals to a and ans[1] equals to b.
/**
 * @param {number[][]} grid
 * @return {number[]}
 */
var findMissingAndRepeatedValues = function(grid) {
       const n = grid.length;
    const expectedSum = (n * n * (n * n + 1)) / 2;
    let actualSum = 0;
    const numCounts = {};
    let repeating = -1;

    // Flatten the matrix and count occurrences of each number
    for (let i = 0; i < n; i++) {
        for (let j = 0; j < n; j++) {
            const num = grid[i][j];
            actualSum += num;

            if (num in numCounts)

installJavaLinux

sudo apt install openjdk-21-jdk

CommandoLinePgBadger.sh

pgbadger -f rds postgres* -t 150 -s 133 -o report_28_02_11_22_1000interacoes_13error.html  -G  -j 4 -J 4

planethoster

nsc.n0c.com

nsb.n0c.com
nsa.n0c.com

Converter URL (PDF) em BLOB

-- Envia PDF e retorna PDF modificado
declare
V_CLOB clob;
V_JSON clob;
G_WALLET_PATH clob;
jsonString VARCHAR2(4000);
jsonObject JSON_OBJECT_T;
v_url VARCHAR2(4000) :=  'https://api.pdf.co/v1/pdf/edit/add';
v_wallet VARCHAR2(4000);
begin
  v_wallet := 'file:/u01/app/oracle/admin/GPMOD10_gru1gm/wallet7';
  jsonString := '{"async":false,"inline":true,"name":"newDocument","url":"https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-edit/sample.pdf","annotations":[{"text":"GREEN color 

Importar Page Oracle Apex

Crie a page no destino e copie o id gerado para colocar na page de origem, 
depois abra o sublime e adicione no replace do 
sublime wwv_flow_imp\.id\((.*?)\) 
para wwv_flow_imp.id(\113), 
onde sera concatenado o número 13 antes de fechar o parentese.

Trabalhando com datas

select rownum dias_ano
   ,to_char(trunc(sysdate,'year')+(rownum-1),'Mon') mes
   ,to_char(trunc(sysdate,'year')+(rownum-1),'YYYY') ano   
   ,to_char(trunc(sysdate,'year')+(rownum-1),'dd') DIA  
   ,to_char(trunc(sysdate,'year')+(rownum-1),'w') semana        
   ,to_char(trunc(sysdate,'year')+(rownum-1),'d') dia_da_semana   
   ,to_char(trunc(sysdate,'year')+(rownum-1),'ddd') dia_do_ano
   ,to_char(trunc(sysdate,'year')+(rownum-1),'day') nome_dia   
    from dual connect by rownum <= ad

JS PARA ADICIONAR FOOTER DE COLUNA COMO TOTALIZADOR/AGREGAÇÃO EM INTERACTIVE GRID

JS PARA ADICIONAR FOOTER DE COLUNA COMO TOTALIZADOR/AGREGAÇÃO EM INTERACTIVE GRID

function atualizarTotal() {
    var ig$ = apex.region("itemOrcamento").widget(); // Substitua "itemOrcamento" pelo Static ID da sua região
    var model = ig$.interactiveGrid("getViews", "grid").model;
    var total = 0;

    model.forEach(function(record) {
        var valorTotal = parseFloat(model.getValue(record, "VALOR_TOTAL")) || 0;
        total += valorTotal;
    });

    console.log(total);

Criar Overflow Overlay Oracle Apex com JS

function fnc_sobrepos() {
    // Criar uma sobreposição para bloquear a tela
    const overlay = $('<div id="custom-overlay"></div>').css({
        position: 'fixed',
        top: 0,
        left: 0,
        width: '100%',
        height: '100%',
        zIndex: 1000,
        backgroundColor: 'rgba(0, 0, 0, 0.5)',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center'
    });

    // Adicionar um spinner
    const spinner = $('<div class="spinner"

Abrir Page Modal com JS - apex

function goToModal(userId) {

    ajaxCallback = {
        success: function (resp)
        {           
            apex.navigation.redirect(resp.url); //do this instead of eval()
        },
                error: function(a,b,c){ console.log(a,b,c)}
    }

    dataSent = {x01: userId};

    apex.server.process('AJAXCB_GOTO_MODAL',dataSent,ajaxCallback);
}


/**
 *         DECLARE
            l_url varchar2(2000);

        BEGIN
            l_url := APEX_PAGE.GET_URL(p_page

Apex Ajax apex.sercer.process

async function setTotatisAbas() {
	let waitPopup = apex.widget.waitPopup();
    await apex.server.process("SET_TOTAIS_ABAS_REL", {
        dataType: "json"
    }, {
        success: function (data) {
            waitPopup.remove();
        	console.log(data);
        },
        error: function (jqXHR, textStatus, errorThrown) {
        	console.log('erro');
            waitPopup.remove();
        }
    });
}

Retorna tabela com a sequencia de valor e quantidade

CREATE OR REPLACE TYPE tp_numero AS OBJECT (numero NUMBER);

CREATE OR REPLACE TYPE tb_numeros AS TABLE OF tp_numero;

CREATE OR REPLACE FUNCTION gerar_numeros_tab(processo_id number,cronograma_id NUMBER, parent_id NUMBER)
RETURN tb_numeros PIPELINED IS
l_valores number;
l_quantidade number;
l_count number;
l_ordem_inicial number;
l_processo_id number;
l_cronograma_id number;
l_parent_id number;
BEGIN
    l_processo_id := processo_id;
    l_cronograma_id := cronograma_id;
    l_p

Efeito Overlay no menu Hamburguer

JS:
var div1 = document.createElement('div');
div1.id = 't_Body_content';


var div2 = document.createElement('div');
div2.id = 'overlay';


document.body.insertBefore(div1, document.body.firstChild);


document.body.insertBefore(div2, div1.nextSibling);
document.getElementById('t_Button_navControl').addEventListener('click', function() {
    setTimeout(() => {
        var ariaExpanded = this.getAttribute('aria-expanded');
        if (ariaExpanded === 'true') {
            docum

Add Sessao APEX

BEGIN
    APEX_UTIL.SET_SESSION_STATE('P85_EMPRESA',null);
    APEX_UTIL.SET_SESSION_STATE('P85_LIVRO',null);
    APEX_UTIL.SET_SESSION_STATE('P85_PERIODO_DE',to_char(trunc(sysdate,'year'),'mm/rrrr'));
    APEX_UTIL.SET_SESSION_STATE('P85_PERIODO_ATE',to_char(sysdate,'mm/rrrr'));
    APEX_UTIL.SET_SESSION_STATE('P85_DESCR_FILTRO','');

END;

Verificar ID Inválido Processo Button

SELECT proc.PAGE_ID
    /*proc.application_id,
    proc.page_id,
    proc.process_name,
    proc.when_button_pressed,
    proc.when_button_pressed_id,
    btn.button_name,
    btn.button_id*/
FROM 
    apex_application_page_proc proc
JOIN 
    apex_application_page_buttons btn
ON 
    proc.application_id = btn.application_id
    AND proc.page_id = btn.page_id
    AND proc.when_button_pressed = btn.button_name
    AND proc.when_button_pressed_id != btn.button_id
WHERE 
    proc.