Skip to content

Instantly share code, notes, and snippets.

View misaki1301's full-sized avatar
🔍
Finding new ways to get bored/focused

misaki1301

🔍
Finding new ways to get bored/focused
View GitHub Profile
@misaki1301
misaki1301 / mysql-docker.sh
Created March 17, 2022 22:03 — 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
<?php
namespace App\Repositories;
use App\Models\Anime;
use App\Models\Character;
use App\Repositories\Interfaces\CharacterRepositoryInterface;
<?php
/*This class replace it on TokenRepository of Laravel\Passport*/
namespace Laravel\Passport;
use Carbon\Carbon;
class TokenRepository
{
/**
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
use NORTHWIND;
select * from Employees
CreaTe DatAbAsE prueba
uSe prueba
CrEaTe TabLe pedidos1(
codigo int primary key,
cliente nchar(5),
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()
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
)
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,
use neptuno;
create procedure usp_dateToDate
@date1 datetime,
@date2 datetime
as
select * from Pedidos where FechaPedido between @date1 and @date2
create procedure usp_detailOrder
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)