- Modificado (modified);
- Preparado (staged/index)
- Consolidado (comitted);
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
// set-up a connection between the client and the server | |
var socket = io.connect(); | |
// let's assume that the client page, once rendered, knows what room it wants to join | |
var room = "abc123"; | |
socket.on('connect', function() { | |
// Connected, let's sign-up for to receive messages for this room | |
socket.emit('room', room); | |
}); |
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 | |
for($m=1; $m<=12; ++$m){ | |
echo date('F', mktime(0, 0, 0, $m, 1)).'<br>'; | |
} |
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 | |
while read oldrev newrev ref | |
do | |
branch=`echo $ref | cut -d/ -f3` | |
if [ "master" == "$branch" ]; then | |
git --work-tree=./path/under/root/dir/live-site/ checkout -f $branch | |
echo 'Changes pushed live.' | |
fi |
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
/** | |
* Simple authentication and authorization example with passport, node_acl, | |
* MongoDB and expressjs | |
* | |
* The example shown here uses local userdata and sessions to remember a | |
* logged in user. Roles are persistent all the way and applied to user | |
* after logging in. | |
* | |
* Usage: | |
* 1. Start this as server |
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
$diasParaSomar = 10; | |
$dataFinal = new DateTime('now'); | |
while ($diasParaSomar) { | |
$dataFinal = $dataFinal->add(new DateInterval('P1D')); | |
if (in_array($dataFinal->format('w'), array(0,6))) { | |
continue; | |
} | |
$diasParaSomar--; | |
} |
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 | |
$diasParaSomar = 10; | |
$dataFinal = new DateTime('now'); | |
while ($diasParaSomar) { | |
$dataFinal = $dataFinal->add(new DateInterval('P1D')); | |
if (in_array($dataFinal->format('w'), array(0,6))) { | |
continue; | |
} | |
$diasParaSomar--; |
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 | |
###Checking for user | |
if [ "$(whoami)" != 'root' ]; then | |
echo "You have no permission to run $0 as non-root user. Use sudo !!!" | |
exit 1 | |
fi | |
###Configure emil and vhost dir | |
email='igordepaula@adminweb.com.br' | |
vhroot='/etc/apache2/sites-available' |
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 | |
// componentes requeridos | |
// composer/composer | |
// symfony/console | |
// classes requeridas | |
// use Composer\Command\UpdateCommand; | |
// use Symfony\Component\Console\Input\ArrayInput; | |
// use Composer\Console\Application; |
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 | |
$vencimento = 30; | |
$firstPag = '30/01/2015'; | |
$parcelas = 15; | |
$data = new DateTime(implode('-', array_reverse(explode('/', $firstPag))) . ' 00:00:00'); | |
$data_parcelas = array(); | |
while ($parcelas) { | |
$mes = $data->sub(new DateInterval('P2D'))->add(new DateInterval('P1M'))->format('n'); |
OlderNewer