DROP FUNCTION IF EXISTS fn_remove_accents;
DELIMITER |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000)
BEGIN
SET @textvalue = textvalue;
-- ACCENTS
This file contains 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 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
var hours = 24; // Reset when storage is more than 24hours | |
var now = new Date().getTime(); | |
var setupTime = localStorage.getItem('setupTime'); | |
if (setupTime == null) { | |
localStorage.setItem('setupTime', now) | |
} else { | |
if(now-setupTime > hours*60*60*1000) { | |
localStorage.clear() | |
localStorage.setItem('setupTime', now); | |
} |
DROP PROCEDURE IF EXISTS dorepeat
CREATE PROCEDURE dorepeat()
BEGIN
DECLARE someId INT;
DECLARE city CHAR(50);
DECLARE done INT DEFAULT FALSE;
DECLARE cur1 CURSOR FOR select id_cidade,cidade from cepbr_cidade ;
DROP PROCEDURE IF EXISTS dorepeat
CREATE PROCEDURE dorepeat()
BEGIN
DECLARE someId INT;
DECLARE neighborhood LONGTEXT;
DECLARE done INT DEFAULT FALSE;
DECLARE cur1 CURSOR FOR select id_bairro,bairro from cepbr_bairro ;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
<script>
bairroSelecionadosArray = bairroSelecionadosArray.filter(function(el){
return el.id !== id;
});
</script>
public function removerAcentos($str){
$str = preg_replace('/[áàãâä]/ui', 'a', $str);
$str = preg_replace('/[éèêë]/ui', 'e', $str);
$str = preg_replace('/[íìîï]/ui', 'i', $str);
$str = preg_replace('/[óòõôö]/ui', 'o', $str);
$str = preg_replace('/[úùûü]/ui', 'u', $str);
$str = preg_replace('/[ç]/ui', 'c', $str);
$str = preg_replace('/[^a-z0-9]/i', ' ', $str);
// $str = preg_replace('/_+/', ' ', $str);
public function removerAcentos($str){
$str = preg_replace('/[áàãâä]/ui', 'a', $str);
$str = preg_replace('/[éèêë]/ui', 'e', $str);
$str = preg_replace('/[íìîï]/ui', 'i', $str);
$str = preg_replace('/[óòõôö]/ui', 'o', $str);
$str = preg_replace('/[úùûü]/ui', 'u', $str);
$str = preg_replace('/[ç]/ui', 'c', $str);
$str = preg_replace('/[^a-z0-9-]/i', ' ', $str);
// $str = preg_replace('/_+/', ' ', $str);
OLDIPV4='' # enter here
NEWIPV4=$(curl -s vestacp.com/what-is-my-ip/)
grep -rl "$OLDIPV4" /etc | xargs sed -i "s#$OLDIPV4#$NEWIPV4#g"
find /home/*/conf/ -type f -exec sed -i "s#$OLDIPV4#$NEWIPV4#g" {} \;
mv /usr/local/vesta/data/ips/$OLDIPV4 /usr/local/vesta/data/ips/$NEWIPV4
mv /etc/apache2/conf.d/$OLDIPV4.conf /etc/apache2/conf.d/$NEWIPV4.conf
mv /etc/nginx/conf.d/$OLDIPV4.conf /etc/nginx/conf.d/$NEWIPV4.conf
grep -rl "$OLDIPV4" /usr/local/vesta/data | xargs sed -i "s#$OLDIPV4#$NEWIPV4#g"
OlderNewer