Skip to content

Instantly share code, notes, and snippets.

@scriptdev
scriptdev / .php
Created October 8, 2022 06:06
EXEMPLO RELATÓRIO TPDFDesigner ( ADIANTI STUDIO )
<?php
function onGerarRelatorio()
{
try
{
TTransaction::open(self::$database);
$repository = new TRepository('Pedido');
$criteria = new TCriteria;
$pedidos = $repository->load($criteria);
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:07
ATUALIZAR LISTA AUTOCOMPLETE TDBEntry
<?php
public static function onSituacao($param)
{
$situacao = $param['key'];
if($situacao)
{
TTransaction::open(self::$database);
@scriptdev
scriptdev / .txt
Created October 10, 2022 23:18
TAMANHO A4 em PIXEL
TAMANHO 72 PPI 96 PPI
A4 595 x 842 794 x 1123

mysql2 gem + mariadb + Alpine Linux

tl;dr Use mariadb-dev. In case of Alpine Linux 3.8, 3.9, use mysql2 >= 0.4.10.

Starting with Alpine Linux 3.8 there are basically 2 options to install the mysql2 gem:

1.sh:

@kedder
kedder / migrate_psql_to_mysql.py
Created October 12, 2019 20:55
Simple script to copy data from postgresql database to mysql with the same schema
"""Convert postgres database to mysql on live running servers
Schemas in both databases should match.
"""
from pprint import pprint
import pymysql.cursors
import psycopg2
import psycopg2.extras
@thepwrtank18
thepwrtank18 / keys.md
Last active April 19, 2024 13:06
Windows XP/2003 Product Keys

Windows XP/2003 Product Keys

These keys have been tested to work. These are a combination of keys from Chinese websites, trial keys inside ISO's, auto-activate keys in OEM ISO's, and directly from Microsoft's website, all aggregated for your convenience.

Usage

In order to use these keys, you need the right edition of Windows XP/2003. Not just Home/Pro/Enteprise/etc, whether it's a Retail, OEM or Volume version. There's a clear cut way to check this.

If you see this, you have a Retail copy.
image

@scriptdev
scriptdev / .php
Last active April 19, 2024 13:05
RELATÓRIO HTML PARA PDF VIA AdiantiHTMLDocumentParser
<?php
$html = new AdiantiHTMLDocumentParser('app/resources/relatorio.html');
$parametros = array(
'{{nome}}' => 'JOÃO DA SILVA',
'{{celular}}' => '(83) 98655-6461'
);
foreach($parametros as $chave => $valor)
@doraTeX
doraTeX / ocr.sh
Last active April 19, 2024 13:04
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine
#!/bin/bash
SCRIPTNAME=$(basename "$0")
function realpath () {
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
@dnaroma
dnaroma / binary.py
Last active April 19, 2024 13:04
Extract AppHash from unity assets
from io import RawIOBase
from struct import *
from typing import Callable
def offset_decorate(func: Callable) -> Callable:
def func_wrapper(*args, **kwargs) -> Callable:
offset = kwargs.get('offset')
if offset is not None: