Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
TTransaction::open('communication'); | |
$data = $this->form->getData(); | |
$this->form->validate(); | |
$object = new SystemMessage; | |
$object->system_user_id = TSession::getValue('userid'); | |
$object->system_user_to_id = $data->system_user_destino_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# HTML IMAGEM CENTRALIZADA NA PÁGINA | |
<!--[main]--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> |
Considering the lack of multi-threaded download support in the official huggingface-cli
, and the inadequate error handling in hf_transfer
, this command-line tool smartly utilizes wget
or aria2
for LFS files and git clone
for the rest.
- ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
- 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
- 🚫 File Exclusion: Use
--exclude
or--include
to skip or specify files, save time for models with duplicate formats (e.g.,*.bin
or*.safetensors
). - 🔐 Auth Support: For gated models that require Huggingface login, use
--hf_username
and--hf_token
to authenticate. - 🪞 Mirror Site Support: Set up with
HF_ENDPOINT
environment variable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# ESTÁTICO ['static' => 1] | |
$btn_onsave = $this->form->addAction("SALVAR", new TAction([$this, 'onSave'],['static' => 1]), 'fas:save #000000'); | |
# NÃO ESTÁTICO | |
$btn_onsave = $this->form->addAction("SALVAR", new TAction([$this, 'onSave']), 'fas:save #000000'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# CRIA A INSTANCIA DO HTML | |
$html = new AdiantiHTMLDocumentParser('app/resources/seu_documento.html'); | |
# PEGA O HTML e ATRIBUI NA VARIÁVEL $documento PARA SER MANIPULADO | |
$documento = $html->getContents(); | |
# CRIA AS ARRAYs COM OS PARÂMETRO PRA SER SUBSTITUÍDOS NO HTML | |
$antes = array('{empresa_nome}', '{empresa_celular}'); | |
$depois = array($empresa_nome, $empresa_celular); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dia_semana = date('N'); | |
print_r($dia_semana); | |
/* | |
1 segunda | |
2 terça | |
3 quarta | |
4 quinta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function BaixarArquivo($param = null) | |
{ | |
try | |
{ | |
$arquivo = $param['arquivo']; # app/output/contrato.pdf | |
$nome = pathinfo($arquivo, PATHINFO_FILENAME); # contrato | |
$extensao = pathinfo($arquivo, PATHINFO_EXTENSION); # .pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$btn_salvar = new TButton('btn_salvar'); | |
$btn_salvar->class = 'btn btn-dark'; |
NewerOlder