Skip to content

Instantly share code, notes, and snippets.

View malkafly's full-sized avatar
🏠
Working from home

d. malk malkafly

🏠
Working from home
View GitHub Profile
@malkafly
malkafly / ajusta_chmod.php
Last active September 30, 2024 12:28
Remover .htaccess maliciosos do wordpress
<?php
// Função para ajustar as permissões de arquivos e diretórios
function ajustarPermissoes($dir) {
// Abre o diretório
$itens = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir),
RecursiveIteratorIterator::SELF_FIRST
);
// Itera sobre cada item (arquivo ou diretório)
@malkafly
malkafly / gist:e535f8c4532efd06319aa54337cc23f3
Created April 12, 2024 22:17 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@malkafly
malkafly / DatabaseNotification.php
Created February 10, 2024 18:15
Using MongoDB for store notifications on Laravel
<?php
namespace App\Overrides\Notifications;
use MongoDB\Laravel\Eloquent\Model;
use MongoDB\Laravel\Eloquent\Builder;
//use Illuminate\Database\Eloquent\Builder;
use Illuminate\Notifications\DatabaseNotificationCollection;

Você deseja um script shell (.sh) para gerenciar backups e restaurações de todos os seus bancos de dados MySQL. Vou criar um script que aceita um argumento opcional. Se um caminho for fornecido, o script tentará restaurar os bancos de dados a partir de um arquivo .sql localizado nesse caminho. Se nenhum caminho for fornecido, ele criará um backup de todos os bancos de dados.

Aqui está um exemplo de como esse script pode ser estruturado:

#!/bin/bash

# Configuração do MySQL
USERNAME="homestead"
PASSWORD="secret"
@malkafly
malkafly / gist:0bb4559d2c3caedbf0928833caae8b9a
Created February 25, 2023 04:22
adicionando o repo do PHP na marra
#!/bin/sh
# To add this repository please do:
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi
${SUDO} apt-get update
${SUDO} apt-get -y install apt-transport-https lsb-release ca-certificates curl
${SUDO} curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
cd /var/www/my_website_serving_dir
sudo chown -R $USER:www-data .
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
@malkafly
malkafly / bancos.php
Created January 1, 2022 00:31
Bancos Brasilieiros com Código - Lista atualizada de 2021 (BEEEM no último dia malandro!)
<?php
$bancos2021Brazzilllzilsilsil = [
'001' => 'Banco Do Brasil S.A (BB)',
'237' => 'Bradesco S.A.',
'335' => 'Banco Digio S.A.',
'260' => 'Nu Pagamentos S.A (Nubank)',
'290' => 'PagSeguro Internet S.A.',
'323' => 'Mercado Pago – Conta Do Mercado Livre',
'237' => 'Next Bank (Mesmo Código Do Bradesco)',
'637' => 'Banco Sofisa S.A (Sofisa Direto)',
@malkafly
malkafly / SubscriptionsSync.php
Created October 27, 2021 02:46
Trait for Sync Subscription from Stripe to Laravel Cashier
<?php
namespace App;
use Stripe;
use Carbon\Carbon;
use Laravel\Cashier\Subscription;
trait SubscriptionsSync {
@malkafly
malkafly / Iugu.php
Created April 19, 2021 16:03
Iugu com Laravel
<?php
namespace App\Helpers;
use Auth;
use Carbon\Carbon;
use Illuminate\Support\Facades\Http;
class Iugu
{
protected $headers;
@malkafly
malkafly / Buyer.php
Created April 19, 2021 16:01
Zoop PHP com Curl
<?php
namespace App\Zoop;
use Auth;
use Carbon\Carbon;
use App\Zoop\ZoopGateway;
class Buyer extends ZoopGateway
{