Skip to content

Instantly share code, notes, and snippets.

@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:
@Daan-Grashoff
Daan-Grashoff / google_search_maps_addon.js
Last active April 19, 2024 13:04
Bring back the google maps button when searching on google
// ==UserScript==
// @name Google maps addon
// @namespace http://tampermonkey.net/
// @version 2024-03-21
// @description Bring google maps button back
// @author You
// @match https://www.google.com/search*
// @include https://www.google.tld/search*
// @icon https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @grant none
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:02
COLUNA SITUAÇÃO DATAGRID
<?php
$column_situacao->setTransformer(function($value, $object, $row)
{
if($value == 'SIM' || $value == 'sim' || $value == 's' || $value == 'T' || $value == true || $value == 't')
{
return '<span class="label label-success">ATIVO</span>';
}
return '<span class="label label-danger">INATIVO</span>';
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active April 19, 2024 13:02
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:02
FORMULÁRIO PASSO A PASSO ( TPageStep )
<?php
$container = new TVBox;
$container->style = 'width: 100%';
$container->class = 'form-container';
$container->add($this->form);
### 1º MÉTODO - USANDO TPageStep
# CRIA AS ETAPAS
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:01
REMOVER BOTÃO ADICIONAR DO TFieldList
<?php
public function onEdit( $param )//</ini>
{
try
{
if (isset($param['key']))
{
$key = $param['key'];
git clone https://github.com/OpenDevin/OpenDevin.git
cd OpenDevin
conda create -n od python=3.10
conda activate od
docker ps
(optional) install docker if not already installed
docker pull ghcr.io/opendevin/sandbox
export OPENAI_API_KEY={your key}
(optional I had to install rust) curl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs/) | sh
(optional) restart terminal
@caraar12345
caraar12345 / proxmox-proxy.md
Last active April 19, 2024 13:01 — forked from basoro/proxmox-proxy
Running Proxmox behind a single IP address

I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables.

What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding.

Network configuration

Here’s how it’s done:

  • Create a virtual interface that serves as the gateway for your VMs:
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:01
REMOVER ACENTOS DO TEXTO
<?php
class Funcao
{
public static function remover_acento($texto)
{
$caracteres = array(
'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A',
'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I',
'Ï'=>'I', 'Ñ'=>'N', 'Ń'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U',