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
#Start docker | |
docker-compose up -d --build --force-recreate | |
#Import database | |
docker exec -i [container] mysql -u[user] -p[pass] [database] -v < [path_of_sql_import] | |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE > backup.sql | |
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | gzip > backup.sql.gz | |
docker exec CONTAINER /usr/bin/mysqldump -u root -pPASSWORD DATABASE | bzip2 > backup.sql.bz2 |
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
#!/usr/bin/env bash | |
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done | |
git fetch --all | |
git pull --all |
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
// usei para renomear os arquivos com extensão php para a primeira letra de cada arquivo para maiuscula | |
rename -v 's{ (\A|\s) (\w+) }{$1\u$2}xmsg' *.php | |
// atualizar a parte tabela do banco de dados | |
https://codeigniter.com/user_guide/libraries/sessions.html#database-driver | |
DROP TABLE ci_sessions; | |
CREATE TABLE IF NOT EXISTS `ci_sessions` ( | |
`id` varchar(128) NOT NULL, | |
`ip_address` varchar(45) NOT NULL, |
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 googleChartColors = [ | |
'#3366CC', '#DC3912', '#FF9900', '#109618', | |
'#990099', '#3B3EAC', '#0099C6', '#DD4477', | |
'#66AA00', '#B82E2E', '#316395', '#994499', | |
'#22AA99', '#AAAA11', '#6633CC', '#E67300', | |
'#8B0707', '#329262', '#5574A6', '#3B3EAC' | |
]; |
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
<?php | |
/** | |
* @param string $string | |
* @param array $avoid (['de', 'da', 'a', 'e', 'o']) | |
* @return string | |
*/ | |
function initials(string $string, array $avoid = null): string | |
{ | |
$words = preg_split("/\s+/", $string); |
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
<?php | |
/** | |
* @param string $string | |
* @param array $avoid (['de', 'da', 'a', 'e', 'o']) | |
* @return string | |
*/ | |
function initials(string $string, array $avoid = null): string | |
{ | |
$words = preg_split("/\s+/", $string); |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import requests,json,sys | |
# Script simples para consulta de dados na base dados nacional do SUS utilizando o CPF. | |
# Jhonathan Davi A.K.A jh00nbr / Insightl4b lab.insightsecurity.com.br | |
# Blog: lab.insightsecurity.com.br | |
# Github: github.com/jh00nbr | |
# Twitter @jh00nbr |
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
#!/bin/sh | |
echo $DEPLOYING | |
if [ -z "$DEPLOYING" ]; then | |
echo 'Deploying site...' | |
export DEPLOYING='yes' | |
git checkout gh-pages | |
git merge master | |
git push origin gh-pages | |
git checkout master |