This file contains hidden or 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
# 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 | |
This file contains hidden or 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 | |
namespace App\Repositories; | |
use App\Models\Anime; | |
use App\Models\Character; | |
use App\Repositories\Interfaces\CharacterRepositoryInterface; |
This file contains hidden or 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 | |
/*This class replace it on TokenRepository of Laravel\Passport*/ | |
namespace Laravel\Passport; | |
use Carbon\Carbon; | |
class TokenRepository | |
{ | |
/** |
This file contains hidden or 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
sudo apt update | |
sudo apt install ca-certificates apt-transport-https | |
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add - | |
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list | |
sudo apt update | |
sudo apt full-upgrade | |
##Para php 7.2: | |
sudo apt install php7.2 | |
sudo apt install php7.2-xdebug php7.2-curl php7.2-gd php7.2-mcrypt php7.2-xml php7.2-xmlrpc php7.2-mysql php7.2-mbstring php7.2-soap php7.2-intl |
This file contains hidden or 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
use NORTHWIND; | |
select * from Employees | |
CreaTe DatAbAsE prueba | |
uSe prueba | |
CrEaTe TabLe pedidos1( | |
codigo int primary key, | |
cliente nchar(5), |
This file contains hidden or 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
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { | |
if editingStyle == .delete { | |
let appDelegate = UIApplication.shared.delegate as! AppDelegate | |
let context = appDelegate.persistentContainer.viewContext | |
let code = codes[indexPath.row] | |
context.delete(code) | |
codes.remove(at: indexPath.row) | |
tableView.deleteRows(at: [indexPath], with: .fade) | |
do { | |
try context.save() |
This file contains hidden or 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
create database dw_inventario | |
use dw_inventario | |
-------------------------------- | |
create table dimTiempo( | |
tiempo_id int primary key identity, | |
fecha date, | |
año int, | |
mes int, | |
dia int | |
) |
This file contains hidden or 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
use dw_semana2; | |
--------------- | |
--Ampliar el modelo estrella, es decir, el modelo copo de nieve | |
--------------- | |
create table dimCategoria( | |
categoryid int primary key, | |
categoryname nvarchar(40)) | |
-------------------------------- | |
create table dimProducto( | |
productid int primary key, |
This file contains hidden or 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
use neptuno; | |
create procedure usp_dateToDate | |
@date1 datetime, | |
@date2 datetime | |
as | |
select * from Pedidos where FechaPedido between @date1 and @date2 | |
create procedure usp_detailOrder |
This file contains hidden or 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
create database TienditaDeDonPepe | |
use TienditaDeDonPepe | |
create table customer( | |
customerId int primary key identity, | |
name varchar(45), | |
lastname varchar(45), | |
telephone int, | |
address varchar(75), | |
dni int) |
NewerOlder