Skip to content

Instantly share code, notes, and snippets.

@scriptdev
scriptdev / .php
Last active April 19, 2024 12:57
SALVAR IMAGEM NO FORMULÁRIO ( TFile + TImage)
<?php
use Adianti\Base\AdiantiFileSaveTrait;
public function __construct( $param )
{
parent::__construct();
@scottmatthewman
scottmatthewman / AdaptsToSoftwareKeyboard.swift
Last active April 19, 2024 12:56
An example of using Combine to automatically adapt a SwiftUI scrollable view to accommodate an iOS onscreen keyboard
import SwiftUI
import Combine
struct AdaptsToSoftwareKeyboard: ViewModifier {
@State var currentHeight: CGFloat = 0
func body(content: Content) -> some View {
content
.padding(.bottom, currentHeight)
.edgesIgnoringSafeArea(.bottom)
@scriptdev
scriptdev / .php
Created November 2, 2022 08:16
INTEGRAR MENSAGENS DA BIBLIOTECA SweetAlert2 NO ADIANTI
<?php
/* IMPORTAR O CSS e JS DO sweetalert2 NO HTML
<link href="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.4.18/sweetalert2.css" rel="stylesheet" type="text/css" media="screen" />
<script src='https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/11.4.18/sweetalert2.js' type='text/javascript'></script>
*/
TScript::create("
Swal.fire(
'SUCESSO!',
@scriptdev
scriptdev / .sql
Last active April 19, 2024 12:55
ATRIBUIR DATA NO CAMPO date DO CADASTRO POR PADRÃO AO INCLUIR O REGISTRO
CREATE TABLE cliente(
`data_cadastro` date DEFAULT 'CURDATE' # MySQL
`data_cadastro` date DEFAULT 'CURRENT_DATE' # PostgreSQL
@scriptdev
scriptdev / .php
Created November 4, 2022 00:45
AÇÃO ESTÁTICA
<?php
$btn_avancar->setAction(new TAction(['onFuncao', 'onShow'],['static' => 1]), "AVANÇAR");
@scriptdev
scriptdev / .php
Last active April 19, 2024 12:54
FILTRO (REGRA DE CARREGAMENTO" USANDO O OPERADOR IN
<?php
# VIA CÓDIGO
$filterVar = array('0001', '0002');
$criteria->add(new TFilter('codigo', 'in', $filterVar));
# NO ADIANTI BUILDER
=['0001','0002']
@scriptdev
scriptdev / WelcomeView.php
Created November 5, 2022 05:34
TELA INICIAL WelcomeView COM IMAGEM
<?php
class WelcomeView extends TPage
{
function __construct()
{
parent::__construct();
$html = new THtmlRenderer('app/resources/welcome_logo.html');
$html->enableSection('main', array());
@vitalyisaev2
vitalyisaev2 / personal_access_token.py
Last active April 19, 2024 12:53
Script for obtaining Gitlab API Personal Access Token
#!/usr/bin/python3
"""
Script that creates Personal Access Token for Gitlab API;
Tested with:
- Gitlab Community Edition 10.1.4
- Gitlab Enterprise Edition 12.6.2
- Gitlab Enterprise Edition 13.4.4
"""
import sys
import requests
@EE2dev
EE2dev / index.html
Last active April 19, 2024 12:49
sequence explorer - single chart
<!DOCTYPE html>
<meta charset="utf-8"> <!-- also save this file as unicode-8 ! -->
<head>
<link rel="stylesheet" type="text/css" href="https://ee2dev.github.io/libs/sankeySeqExplorer.v20.css">
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://ee2dev.github.io/libs/sequence-explorer.v20.min.js"></script>
</head>
<body>
<script>
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active April 19, 2024 12:48
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages