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 / 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
{
@malkafly
malkafly / README.md
Created June 3, 2020 19:36 — forked from dalezak/README.md
Ionic Capacitor Resources Generator
  1. Run npm install cordova-res --save-dev
  2. Create 1024x1024px icon at resources/icon.png
  3. Create 2732x2732px splash at resources/splash.png
  4. Add "resources": "cordova-res ios && cordova-res android && node scripts/resources.js" to scripts in package.json
  5. Copy resources.js file to scripts/resources.js
  6. Run sudo chmod -R 777 scripts/resources.js
  7. Run npm run resources