Skip to content

Instantly share code, notes, and snippets.

@MikuroXina
MikuroXina / endless-error-loop.py
Created December 26, 2022 15:50
Lyrics of "Endless Error Loop" by Neko Hacker feat. ななひら.
print('''<header>
ここをもうちょっとシンプルに変えてっと
え、なにこのエラー・・・
</header>''')
try:
uglyCode()
except:
print('よくあるError')
try:
@scriptdev
scriptdev / .php
Last active April 19, 2024 01:48
DEFINIR OS BOTÕES DE AÇÃO DO THtmlEditor
<?php
$html = new THtmlEditor('texto');
$html->setOption('toolbar',[
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
@scriptdev
scriptdev / .php
Created December 12, 2023 16:38
RETORNAR IDS ARRAY DOS REGISTROS VINCULADOS
<?php
$GruposCliente = GruposCliente::where('cliente_id', '=', $object->id)->getIndexedArray('grupo_cliente_id', 'grupo_cliente_id');
/*
Array
(
[1] => 1
[2] => 2
[4] => 4
@JNNGL
JNNGL / generator.py
Last active April 19, 2024 01:47
Animated emojis in vanilla Minecraft
#!/usr/bin/python3
import math
import argparse
from PIL import Image
def build_frames(gif, animation_seconds):
num_frames = math.floor(gif.n_frames)
frame_width, frame_height = gif.size
@scriptdev
scriptdev / .php
Created December 12, 2023 18:28
CABEÇALHO DE RELATÓRIO TABULAR
<?php
$tr->addStyle('title', 'Courier', '10', 'B', '#000000', '#dbdbdb');
if ($format == 'pdf')
{
$tr->setHeaderCallback(
function($tr)
{
$pdf = $tr->getNativeWriter();
@scriptdev
scriptdev / .php
Created December 14, 2023 21:26
ATUALIZAR DATAGRID MÉTODO A CADA TEMPO
<?php
public function __construct($param = null)
{
parent::__construct();
$this->form = new BootstrapFormBuilder(self::$formName);
$this->form->setFormTitle("PEDIDOS - DELIVERY");
$this->limit = 20;
@USM-F
USM-F / MCKP.py
Last active April 19, 2024 01:45
Dynamic programming solution of Multiple-Choice Knapsack Problem (MCKP) in Python
#groups is list of integers in ascending order without gaps
def getRow(lists, row):
res = []
for l in lists:
for i in range(len(l)):
if i==row:
res.append(l[i])
return res
@scriptdev
scriptdev / .php
Created December 16, 2023 00:47
SIMULAR FOCO NO CAMPO
<?php
TScript::create('$("[name=\'NOME_CAMPO\']").blur();');
@ferferga
ferferga / delete_ghcr_dangling_images.sh
Created September 7, 2021 17:12
Deletes untagged images from GitHub Container Registry package using gh cli
#!/bin/bash
set -e
# Simple script to remove dangling images from GHCR.
# You need to have installed gh cli and jq for this script to work properly
# You need to be logged to 'gh' first
container="debian/buildd"
temp_file="ghcr_prune.ids"
rm -rf $temp_file
@scriptdev
scriptdev / .txt
Created December 18, 2023 22:42
ATIVAR WINDOWS 10 ( PowerShell )
COMANDOS:
1 - Windows PowerShell
2 - irm https://massgrave.dev/get | iex