Skip to content

Instantly share code, notes, and snippets.

@scriptdev
scriptdev / .php
Last active April 19, 2024 01:27
BUSCAR REGISTRO MESMO QUE SEJA EXCLUIDO COM SOFTDELETE
<?php
$pessoa = Pessoa:find($id, True); # ADICIONE O TRUE NO FINAL DO MÉTODO FIND
@ChuckMichael
ChuckMichael / vcredistr.md
Last active April 19, 2024 01:26
Visual C++ Redistributable Packages
@iamwill
iamwill / debugging_cheatsheet.md
Last active April 19, 2024 01:24
Debugging on the Glide Platform

Debugging tips and tricks

Platform Troubleshooting

Console output too chatty?
Set com.glide.util.Log.developer_filter = true to cut down on non-interactive console log entries such as scheduled workers. (Don't forget to remove it when you're done!)

Utility urls

Note: Fast! These don't need a database.

@iamwill
iamwill / gliderecord_cheatsheet.md
Last active April 19, 2024 01:24
GlideRecord cheatsheet

GlideRecord & GlideAggregate Cheat Sheet ❗

GlideRecord(String tableName) ❗

var gr = new GlideRecord('incident'); // use the incident table
gr.query(); // fetch data from the database
while (gr.next()) { // advance
    gs.info(gr.short_description);
}
@scriptdev
scriptdev / .php
Created March 4, 2024 20:19
FILTRAR PRIMEIRO e ÚLTIMO DIA DO MÊS
<?php
$primeiro_dia_mes = date('Y-m-01');
$ultimo_dia_mes = date("Y-m-t");
$criteria->add(new TFilter('data_venda','>=', date('Y-m-01')));
$criteria->add(new TFilter('data_venda','<=', date('Y-m-t')));
@scriptdev
scriptdev / .php
Created March 12, 2024 04:03
ADICIONAR HTML NO FORMULÁRIO COM THtmlRenderer ( addContent )
<?php
$html = new THtmlRenderer('app/resources/arquivo.html');
$html->disableHtmlConversion();
$html->enableSection('main',[]);
$this->form->addContent([$html]);
parent::add($container);
@scriptdev
scriptdev / .php
Created March 13, 2024 01:26
ADICIONAR IMAGEM NO BOTÃO ( TButton )
<?php
$btn_qrcode->setImage('app/output/qrcode.png');

ServiceNow UI Developer cheat sheet


Utility URLs

URL Purpose
/stats.do Quick stats
/cache.do Clear your instance cache
@Archenoth
Archenoth / service
Last active April 19, 2024 01:22
Termux service management script, because convenience, and also because I wanna have fewer runit watchers running all the time
#!/bin/sh
# This script 100% requires termux-services to be installed
if ! dpkg -L termux-services 2>&1 >/dev/null; then
echo "Requires termux-services package to be installed." >&2
read -r -p "Would you like me to install that now? (y/n) " INSTALL >&2
if [ "$INSTALL" != "y" ]; then
echo "Aborting..." >&2
exit 1
@scriptdev
scriptdev / .php
Created March 19, 2024 01:26
CRIAR CÓDIGO TOKEN
<?php
$object = new Pedido();
$object->token = 'TK'.date('YmdHis').''.uniqid();
$object->store();
# EXEMPLO: TK2024031811492663b6e376917bf