$ cd /path/to/your/website
$ rm -Rf ./lib
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 | |
function adicionaDiasUteis(int $numDias=0, DateTime $data):DateTime { | |
$dataFim = clone $data; | |
$umdia = new DateInterval('P1D'); // intervalo fixo | |
for ($i=0; $i<$numDias; $i++) { | |
$dataFim->add($umdia); | |
if ($dataFim->format('w') == "0" || $dataFim->format('w') == "6") { | |
$i--; // retorna o contador, caso seja sábado ou domingo | |
} |
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
<% | |
Function Base64Encode(sText) | |
Dim oXML, oNode | |
Set oXML = CreateObject("Msxml2.DOMDocument.3.0") | |
Set oNode = oXML.CreateElement("base64") | |
oNode.dataType = "bin.base64" | |
oNode.nodeTypedValue = Stream_StringToBinary(sText) | |
Base64Encode = oNode.text | |
Set oNode = Nothing | |
Set oXML = Nothing |
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
# source: https://davidwalsh.name/video-preview | |
# sample in PHP => https://gist.github.com/AkgunFatih/88c2241865c25e40a50edc4e24679a94 | |
sourcefile=$1 | |
destfile=$2 | |
# Overly simple validation | |
if [ ! -e "$sourcefile" ]; then | |
echo 'Please provide an existing input file.' |
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 | |
class DB { | |
/** | |
* @var DB | |
*/ | |
private static $instancia = NULL; | |
/** | |
* @var Mysql link identifier |
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 | |
class GetrsSetrs { | |
public function __call($name, $arguments) { | |
$action = substr($name, 0, 3); | |
if ($action == 'get') { | |
return $this->get(lcfirst(substr($name, 3))); | |
} | |
else if ($action == 'set') { |
curl --anyauth --user 'USUARIO:SENHA' -T ARQUIVO_LOCAL PREFIXO_WEBDAV+ARQUIVO_REMOTO
#EXEMPLO: #curl --anyauth --user 'USUARIO:SENHA' VSCode-win32-x64-1.26.1.zip -T https://expressomgdrive.mg.gov.br/remote.php/webdav/testehaha/VSCode-win32-x64-1.26.1.zip
#referência > https://code.blogs.iiidefix.net/posts/webdav-with-curl/
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
alias.lg log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
alias.lg2 log --pretty='%h - %s (%an)' | |
alias.alias config --get-regexp ^alias\. | |
alias.unadd reset HEAD -- | |
alias.unstage reset HEAD -- |
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
##Test | |
Exclude | |
##Books | |
Chrome | |
Movies | |
Music | |
##PlayGames | |
Talkback |
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
anos=`seq 2016 2018`; # 2016 a 2018 | |
meses=`seq -w 1 12`; # todos os meses | |
for ano in $anos | |
do | |
for mes in $meses | |
do | |
data=$ano$mes; | |
tam=`du -c DCIM/**/IMG_$data*.jpg DCIM/**/VID_$data*.mp4 2> /dev/null | tail -1 | cut -f 1` | |
echo $data: $tam |