Skip to content

Instantly share code, notes, and snippets.

@andrey0029
andrey0029 / pdf-example.blade.php
Created April 21, 2021 14:42 — forked from alfredoem/pdf-example.blade.php
Template for a invoice render with DomPDF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aloha!</title>
<style type="text/css">
* {
font-family: Verdana, Arial, sans-serif;
}
@andrey0029
andrey0029 / gist:ff96967dd3d62970c88eb7b532348dfb
Created April 18, 2021 08:59 — forked from rdgutierrez/gist:b06fae22348cd0376836
Fechas en español con Carbon en Laravel 5
Using a library as Laravel-Date you will just need to set the language of the app in the Laravel app config file and use its functions to format the date as you want.
Set the language in /app/config/app.php
...
'locale' => 'es',
...
I've found this library pretty useful and clean. To use it, you can write something like the example in the library readme file. I leave the results in spanish.
...
echo Date::now()->format('l j F Y H:i:s'); // domingo 28 abril 2013 21:58:16
echo Date::parse('-1 day')->diffForHumans(); // 1 día atrás
@andrey0029
andrey0029 / mysql-docker.sh
Created November 10, 2020 19:33 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@andrey0029
andrey0029 / pdf-invoice.html
Created October 14, 2020 07:38 — forked from channaveer/pdf-invoice.html
Invoice Sample HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Some Random Title</title>
<style>
body{