Skip to content

Instantly share code, notes, and snippets.

View osoda's full-sized avatar
💻
Developing

osoda osoda

💻
Developing
View GitHub Profile
@osoda
osoda / dump.sh
Last active November 7, 2018 23:24 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
### (v2)
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## IGNORE THIS BLOCK TO >=(v2)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
@osoda
osoda / GetFinalDate_NotIncludingHolydate.sql
Last active October 20, 2017 14:23
Trae el día final, los números de festivos y el siguiente día festivo de una fecha inicial (actual). La cual se le quiere calcular el ultimo día hábil (de trabajo)
#Get the final date not including holydates, having the numbers days that want calculate and the date inicial
#Try in http://rextester.com/live/QACMX44672
# EN este ejemplo se prueba con un numero de dias de 30 y con la fecha inicial la de hoy.
# Se debe tener la tabla con cada fecha festiva despues de el dia de fecha inicia, incluyendo domingos tal como la tabla que se crea,
# este ejemplo se probo el dia 19 de octubre de 2017
CREATE TABLE IF NOT EXISTS `festivos` (
`dia` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci;