Skip to content

Instantly share code, notes, and snippets.

Avatar

Thiago Duarte tduarte

View GitHub Profile
@tduarte
tduarte / publish-ghpages.md
Last active Oct 26, 2020
If you need to force push an subtree
View publish-ghpages.md
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@tduarte
tduarte / gitcommand.md
Created Oct 14, 2016
When you can't stash a modified file
View gitcommand.md
git ls-files -m | xargs -I {} git update-index --assume-unchanged {}
@tduarte
tduarte / enviar.php
Last active Dec 29, 2015
Script para quem precisa enviar e-mails pelo PHP de forma simples via POST.
View enviar.php
<?php
// Colocar na tag form os seguintes atributos: <form method="post" action="enviar.php">
$para = "destino@dominio.com.br"; // Mudar o e-mail para o destinatário
$assunto = "Formulário de Contato"; // Assunto do E-mail
$mensagem = "<strong>Nome: </strong>".$_POST['posto']; // Campos do formulário. Colocar o equivalente no atributo name do campo.
$mensagem .= "<br><strong>E-mail: </strong>".$_POST['email']; // Campos do formulário. Colocar o equivalente no atributo name do campo.
You can’t perform that action at this time.