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($){ | |
//========================================================================================= | |
$.ajaxUpload = function(config) { | |
var formData = new FormData(); | |
var data = config.data; | |
for(var i in data){ | |
formData.append(i, data[i]); | |
} | |
return $.ajax({ | |
type: "POST", |
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 Paginacao = (function($) { | |
"use strict"; | |
var Paginacao = function() { | |
this.qtdRegistroPorPagina = 10; | |
this.qtdDePaginacao = 7; | |
this.template = ["<ul data-pg=\"container\" class=\"pagination\" > ", | |
"<li data-pg=\"anterior\" ><a href=\"javascript:;\">«</a></li>", | |
"<li data-pg=\"numeros\" > <a href=\"javascript:;\"> {@numero} </a> </li>", | |
"<li data-pg=\"proximo\" ><a href=\"javascript:;\">»</a></li> ", | |
"</ul>" |
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/bash | |
#id do usuario | |
USUARIO="victorvhpg" | |
# pega json que contem todos os repositorios e extrai as URLs | |
LISTA_URL_CLONES=`curl --silent https://api.github.com/users/${USUARIO}/repos -q | grep "\"clone_url\"" | awk -F': "' '{print $2}' | sed -e 's/",//g'` | |
#para cada url faz um 'git clone' | |
for URL in $LISTA_URL_CLONES; do |
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 ajaxPromise(config) { | |
return new Promise( | |
function(resolve, reject) { | |
var xhr = new XMLHttpRequest(); | |
var p = []; | |
var parametros = null; | |
config.parametros = config.parametros || {}; | |
for (var parametro in config.parametros) { | |
p.push(parametro + "=" + config.parametros[parametro]); | |
} |
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
//callbacks dentro de callbacks | |
algumaCoisa1(function(resposta1) { | |
//... | |
algumaCoisa2(function(resposta2) { | |
//... | |
algumaCoisa3(function(resposta3) { | |
//... | |
acaoFinal(resposta3); | |
}); | |
}); |
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(window) { | |
"use strict"; | |
//criamos uma funcao auto executavel que recebe uma function "fnCriaPlugin" | |
//que eh a implementacao do nosso plugin | |
(function(fnCriaPlugin) { | |
//agora eh so verificar se possui AMD ou nao | |
if (typeof define === "function" && define.amd) { | |
// COM suporte AMD | |
//entao registra o plugin com a depedencia jquery |
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
sudo apt-get install apache2 apache2-utils |
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
#habilita os modulos necessarios | |
sudo a2enmod cgi alias env auth_digest |
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
#usando apt-get | |
sudo apt-get install git | |
#compilando a partir do codigo fonte | |
#baixe a ultima versao do GIT aqui: https://www.kernel.org/pub/software/scm/git | |
#por exemplo a versao 2.2.1 https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz | |
#depois descompacte e compile ele: | |
wget https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz | |
tar -zxf git-2.2.1.tar.gz |
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
<VirtualHost *:80> | |
ServerAdmin victorvhpg@gmail.com | |
ServerName git.exemplo | |
DocumentRoot /var/www/git | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
#local onde estao os repositorios git |
OlderNewer