Skip to content

Instantly share code, notes, and snippets.

View igoralves1's full-sized avatar

Igor Alves igoralves1

View GitHub Profile
@igoralves1
igoralves1 / Display googleMap inside ROW bootstrap
Created June 5, 2016 18:28
Display googleMap inside ROW bootstrap
$(window).resize(function () {
var h = $(window).height(),
offsetTop = 60; // Calculate the top offset
$('#map').css('height', (h - offsetTop));
}).resize();
@igoralves1
igoralves1 / gist:2dc293f4527268a582993b0df184ff02
Last active September 7, 2016 09:38
Validar data - data validator ==> datapicker
//Validar datas:
//Quando abre o datapicker seleciona a menor data para ser o dia de hoje now().
var now = new Date(),
minDateJS = now.toISOString().substring(0,10);
//Seleciona a data de entrega do produto.
//Aplica a data now (hoje) para ser a menor data selecionavel para a entrega do produto
//Aplica a data de entrega do produto para ser a menor data possivel do evento
$('#dt_entregaProd').datepicker({
@igoralves1
igoralves1 / Virtual Host
Last active June 3, 2019 01:54
APACHE - Windows XAMPP (Portuguese)
Usando xampp (apache) no windows:
0-NOTA: Melhor desligar o apache antes de fazer essas alteralcoes, ou ele podera causar erro quando for incializado novamente.
1-URL localhost aponta para o IP 127.0.0.1. Isso pode ser encontrado em C:\Windows\System32\drivers\etc\hosts ===> 127.0.0.1 localhost.
2-Fisicamente localhost aponta para C:\xampp\htdocs que vai abrir o arquivo index.php que se encontra l[a.
3-Se abrirmos o arquivo C:\Windows\System32\drivers\etc\hosts e escrevermos uma linha 127.0.0.1 test, estamos instruindo o servidor para apontar para a mesma pasta que o localhost. Ent'ao test vai apontar fisicamente para C:\Windows\System32\drivers\etc\hosts.
4-A prova disso [e se formos na URL e digitarmos test/ vai abrir a mesma p[agina que localhost/.
5-Temos que editar o arquivo C:/xampp/apache/conf/extra/httpd-vhosts.conf. Diferentes versoes do apache, dependendo do sistema operacional e a empresa que instalou o programa (xampp no caso) pode escolher um arquivo diferente para guaradar informacoes do virtu
//Temos o seguinte código HTML que gera um objeto de upload.
<form action="upload.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload Image" name="submit">
</form>
Note o "id" do elemento input type "file".
De maneira estática o id seria: id="fileToUpload".
De maneira dinâmica podemos adicionar uma primary key ou identificador de uma database. Entáo ficaria assim:
@igoralves1
igoralves1 / Quick Bash Studies
Last active September 7, 2016 09:35
BASH Programming - Introduction HOW-TO by Mike G mikkey at dynamo.com.ar
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc3
@igoralves1
igoralves1 / gist:1563db35bf57853a6ca7ad9491dc449d
Created July 6, 2016 01:20
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
<img class="bg" src="assets/img/HomePage_Photo.jpg" alt="" style="width: 100%; height: auto; position: fixed;top: 0;left: 0;"><!-- Dislay full image https://css-tricks.com/perfect-full-page-background-image/-->
@igoralves1
igoralves1 / Recuperar URL
Created July 26, 2016 02:08
Laravel - Recuperar URL
Route::get('/', array('as'=>'URL',function () {
$Env = substr(URL::route('URL'), 7, 2);
$str ="ENV is $Env" ;
return $str;
}));
@igoralves1
igoralves1 / gist:11a0de59c6618dd92e347f859c50bed6
Created August 2, 2016 14:19
Sending forms, redirecting pages.
//Html code
<form method="post" action="#"> .... //Set action to action="#"
//Submit form using JS ---------------------------------------------------------------------------------------------------------------
$('.btn_submit').on( 'click', function() {
//alert("myTest");
//return false; // That will stop the flow to the next lines.
var objectEvent=$(this);
@igoralves1
igoralves1 / LEMP
Last active September 8, 2016 17:31
LEMP - Stack
***********************************************************************************************
{Linux + NginX + MariaDb + PHP7}
***********************************************************************************************
************************ # ####### ## ## ####### ************************
************************ # # # # # # # # ************************
************************ # ####### # # # # ####### ************************
************************ # # # # # # # ************************
************************ ####### ####### # # # # ************************
***********************************************************************************************
by igoralves1