Skip to content

Instantly share code, notes, and snippets.

@scriptdev
scriptdev / .php
Created December 4, 2023 18:39
ENVIAR VALOR PARA O CAMPO DO TFieldList
<?php
$campo_id = explode('_', $param['_field_id']);
$campo_id = end($campo_id);
$object = new stdClass();
$object->{"venda_item_valor_{$campo_id}"} = number_format($valor, 2, ',', '.');
TForm::sendData(self::$formName, $object);
@scriptdev
scriptdev / .php
Created December 5, 2023 17:49
ATUALIZAR DINAMICAMENTE O TDBCheckGroup
<?php
TDBCheckGroup::reloadFromModel(self::$formName, 'nome_campo', self::$database, 'Cliente', 'id', '{nome}','nome asc');
@scriptdev
scriptdev / .php
Created December 6, 2023 03:57
SIMULAR AÇÃO DE SAÍDA DO CAMPO ( PHP / JAVASCRIPT )
<?php
TScript::create('$("[name=\'NOME_CAMPO\']").blur();');
/**
* ---------------------------------------------------------
* | Esp-32/Arduino Stair Led Relay control |
* | By SchizoDuckie, ©2019 |
* | |
* | Disclaimer: |
* | I am in no way, shape or form responsible for |
* | - You setting your house on fire |
* | - Your firstborn suddenly getting autism |
* | - Your girlfriend running off with the neighbour |
@scriptdev
scriptdev / .css
Created December 6, 2023 04:46
CRIAR ESPAÇAMENTO AÇÃO DO DATAGRID ( ADIANTI )
td.tdatagrid_cell.action {
padding-right: 15px !important;
}
@scriptdev
scriptdev / .html
Created December 11, 2023 02:38
TEMPLATE IMAGEM HTML
<!--[main]-->
<div>
<img style="height:200px !important" src="{{URL}}">
</div>
<!--[/main]-->
@scriptdev
scriptdev / .php
Created December 10, 2023 23:04
EXTRAIR DDD e NÚMERO DO CELULAR
<?php
$celular = str_replace(['(',')','-',' '], ['','','',''], '(83) 98655-6461');
$ddd = substr($celular, 0, 2); # 83
$numero = substr($celular, 2); # 986556461
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active April 19, 2024 01:54
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@scriptdev
scriptdev / .css
Created December 6, 2023 18:20
MUDAR COR DE FUNDO DA LINHA NO DATAGRID
.tdatagrid_cell{
background-color:#ffffff !important;
}
@cmparlettpelleriti
cmparlettpelleriti / R_EigenPCA_Plots.R
Last active April 19, 2024 01:51
Show students the relationship between Eigendecomp of Cor/Cov and the % variance explained for PCs
library(tidyverse)
library(MASS)
library(patchwork)
cbPalette <- c("#999999", "#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
# generate data with given cor matrix
a <- 0.9
s1 <- matrix(c(1,a,
a,1), ncol = 2)