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> | |
ServerName api.sellead.dev | |
DocumentRoot /var/www/sellead.dev/api/public | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride None | |
</Directory> | |
<Directory /var/www/sellead.dev/api> |
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
Conexões Internet Ativas (sem os servidores) | |
Proto Recv-Q Send-Q Endereço Local Endereço Remoto Estado | |
tcp 0 0 dev.local:46284 189.103.27.109:https ESTABELECIDA | |
tcp 1 0 bd6710e1.virtua.c:59381 209-20-75-76.slice:http ESPERANDO_FECHAR | |
tcp 0 0 localhost:46727 localhost:2222 ESTABELECIDA | |
tcp 0 0 dev.local:54110 gru09s17-in-f5.1e:https ESTABELECIDA | |
tcp 0 0 dev.local:35543 173.194.219.94:https ESTABELECIDA | |
tcp 0 0 dev.local:45580 189.103.27.106:https ESTABELECIDA | |
tcp 0 0 localhost:2222 localhost:46727 ESTABELECIDA | |
tcp 0 0 dev.local:33103 64.233.186.189:https ESTABELECIDA |
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 xhr = new XMLHttpRequest(); //to reuse o intervals. Creating one for each request causes heavy CPU load | |
var CommentBox = React.createClass({ | |
getInitialState: function() { | |
return {data: []}; | |
}, | |
loadCommentsFromServer: function() { | |
var cp = this; |
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 MersenneTwister = function(seed) { | |
if (seed == undefined) { | |
seed = new Date().getTime(); | |
} | |
/* Period parameters */ | |
this.N = 624; | |
this.M = 397; | |
this.MATRIX_A = 0x9908b0df; /* constant vector a */ | |
this.UPPER_MASK = 0x80000000; /* most significant w-r bits */ |
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 XhrRequestExample { | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.onreadystatechange=function() { | |
if (xmlhttp.readyState==4 && xmlhttp.status==200){ | |
//handle success | |
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
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
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 update && apt-get update | |
apt-get install apache2 php5 php5-mcrypt git | |
curl -sL https://deb.nodesource.com/setup | sudo bash - | |
sudo apt-get install nodejs | |
sudo npm install -g grunt-cli bower gulp | |
sudo apt-get install php5-dev php-pear |
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 xmlhttp = new XMLHttpRequest(); // esse carinha faz requisições | |
// aqui você prepara a função de callback (caso queira usar) | função que vai ser chamada depois da resposta do servidor | |
xmlhttp.onreadystatechange=function() { | |
if (xmlhttp.readyState==4 && xmlhttp.status==200) { // quando a requisição tiver sucesso | |
var dados = JSON.parse(xmlhttp.responseText); // caso a resposta do servidor seja em JSON | |
// faça o que quiser | |
} |
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
echo ==== deploying application ===== | |
echo ========= checking out ========= | |
git --work-tree=/var/www/projeto/api/src --git-dir=/var/www/projeto/api/repository.git checkout -f | |
echo ========= installing dependencies ========= | |
( cd /var/www/projeto/api/src && composer install && php artisan migrate ) | |
echo =========== complete =========== |
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 find . -type d -exec chmod 775 {} \; && find . -type f -exec chmod 664 {} \; |