start new:
tmux
start new with session name:
tmux new -s myname
# To ignore a file or dir | |
git update-index --assume-unchanged <file> | |
#To revert that ignorance use the following command: | |
git update-index --no-assume-unchanged <file> |
karma start karma.conf.js | tee >( xargs -I {} notify-send {}) |
var exec = require('child_process').exec; | |
var notify = function(message) { | |
exec('notify-send "' + message + '"'); | |
}; |
<?php | |
// This will allow you to use any view helper in any class such as a controller // | |
// 1. Instantiate the view helper. | |
// 2. Configure it. | |
// 3. Use it. | |
// E.g. Use currency formatter | |
$currencyFormatter = new CurrencyFormat(); | |
$currencyFormatter->setCurrencyCode('USD'); | |
$currencyFormatter->setLocale('en_US'); |
<?php | |
$array = [null, 1, null, 2, 3, 5]; | |
var_dump(array_filter($array)); | |
// This also works for numeric index values, notice how the null value indexes are stripped | |
$array = [ | |
0 => null, | |
1 => 22, | |
2 => null, | |
3 => 1, |
<?php // formulario.php | |
// Para saber a donde apunta el formulario fijate en el atributo action del form: | |
<form action="server/script.php" name='nombre_formulario'> | |
</form> | |
?> | |
<?php /* server/script.php */ // Aquí es a donde llega el form anterior | |
if (isset($_POST['nombre_formulario'])) { |
#!/usr/bin/env ruby | |
require 'json' | |
require 'fileutils' | |
include FileUtils | |
# Parses the argument array _args_, according to the pattern _s_, to | |
# retrieve the single character command line options from it. If _s_ is | |
# 'xy:' an option '-x' without an option argument is searched, and an | |
# option '-y foo' with an option argument ('foo'). |
docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container-id-or-name> |