This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Usage: ./setup-queue.sh | |
# (at magento's root dir) | |
# | |
# This will update your app/etc/env.php with the config needed | |
# to process magento queued messages (background jobs) using mysql + cron, | |
# executing them alongside your regular bin/magento cron:run scheduling | |
# Backup the env.php file to app/etc/env.php.bkp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FLATPAK_STEAM_PATH=~/.var/app/com.valvesoftware.Steam | |
[ ! -d "$FLATPAK_STEAM_PATH" ] && echo 'Flatpak Steam not found' && exit 1 | |
# Copy the icon files | |
USER_ICONS_PATH=~/.local/share/icons | |
mkdir -p "$USER_ICONS_PATH" | |
rsync -a "$FLATPAK_STEAM_PATH"/data/icons/* "$USER_ICONS_PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mkdir -p /mnt/fedora/ | |
mount /dev/nvme0n1p6 /mnt/fedora/ -t btrfs -o subvol=root | |
mount /dev/nvme0n1p6 /mnt/fedora/home -t btrfs -o subvol=home | |
mount /dev/nvme0n1p5 /mnt/fedora/boot/ | |
mount /dev/nvme0n1p1 /mnt/fedora/boot/efi/ | |
dnf install -y arch-install-scripts | |
arch-chroot /mnt/fedora |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Credits: | |
## https://thomas-leister.de/en/repair-fedora-efi-bootloader/ | |
## https://fedoramagazine.org/os-chroot-101-covering-btrfs-subvolumes/ | |
mkdir -p /mnt/fedora/ | |
mount /dev/nvme0n1p6 /mnt/fedora/ -t btrfs -o subvol=root | |
mount /dev/nvme0n1p6 /mnt/fedora/home -t btrfs -o subvol=home | |
mount /dev/nvme0n1p5 /mnt/fedora/boot/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- outdated browser --> | |
<div id="outdated"></div> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.js"></script> | |
<script>jQuery(document).ready(function () {outdatedBrowser({ lowerThan: 'grid', languagePath: 'https://raw.githubusercontent.com/outdatedbrowser/outdated-browser/develop/outdatedbrowser/lang/pt-br.html' })})</script> | |
<!-- end outdated browser --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$runBench = function ($val, Closure $callable, string $using) : array { | |
$startTime = microtime(true); | |
for ($i = 0; $i < 1000000; $i++) { | |
$callable($val); | |
} | |
$elapsedTime = microtime(true) - $startTime; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const submitForm = form => { | |
// se quiser colocar um efeito de loading, ele vai aqui | |
const previousMessage = form.querySelector('.message') | |
if (previousMessage) { | |
form.removeChild(previousMessage) // remove a mensagem de algum submit anterior | |
} | |
const body = new FormData(form) // coloca os inputs/select/textarea do form numa variável | |
const method = form.method // pega o método do form (GET/POST) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$customers = []; | |
for ($count = 1; $count < 100000; $count++) { | |
$customers[] = [ | |
'id' => $count, | |
'name' => array_random(['Lorem', 'Ipsum', 'Dolor']), | |
]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$mediaDir = Mage::getBaseDir('media'); | |
$varDir = Mage::getBaseDir('var'); | |
$backupDir = "$varDir/media_unused"; | |
if (!is_dir($backupDir)) { | |
mkdir($backupDir, 0770, true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
Mage::app()->getLocale()->emulate(1); | |
// loads the proper email template | |
$emailTemplate = Mage::getModel('core/email_template')->loadDefault('eflips_new_order'); | |
// $emailTemplate = Mage::getModel('core/email_template')->loadDefault('sales_email_order_template'); | |
// $emailTemplate = Mage::getModel('core/email_template')->loadByCode('2 - Pedido Realizado (NOVO)'); |
NewerOlder