###SSH into a remote machine###
ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1
exit: exit
###Install Something###
#If it's a new server, update apt-get first thing
###SSH into a remote machine###
ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1
exit: exit
###Install Something###
#If it's a new server, update apt-get first thing
// The Sieve of Eratosthenes! | |
// This gist was created so I can remember the algorithm cited here: http://qr.ae/RA6nsm | |
function sieve(max) { | |
var D = [], primes = []; | |
for (var q=2; q<max; q++) { | |
if (D[q]) { | |
for (var i=0; i<D[q].length; i++) { | |
var p = D[q][i]; | |
if (D[p+q]) D[p+q].push(p); | |
else D[p+q]=[p]; |
###Getting help npm help
###Updating npm npm install npm -g
###Verifying the account your logged into npm whoami
###Creating a new account
<?php | |
/** Retorna que valida CPF retorna FALSE se errado e TRUE se correto | |
* Fonte: http://www.geradorcpf.com/script-validar-cpf-php.htm | |
*/ | |
static function validaCPF($cpf) { | |
// Verifica se um número foi informado | |
if(empty($cpf)) { | |
return false; | |
} |
/** source: http://stackoverflow.com/a/18608587/1252947 **/ | |
<?php | |
<select id="year"> | |
<? | |
$currentValue = date("Y"); | |
$past = 20; | |
$future = 0; | |
if ($currentValue && ($currentValue < date('Y') - $past || $currentValue > date('Y') + $future)) { | |
echo "<option value=\"$currentValue\" selected=\"selected\">$currentValue</option>\n"; | |
} |
Comandos acessíveis do terminal estão localizados em alguma pasta cadastrada no PATH do sistema. Para descobrir de qual pasta o comando está sendo chamado use o comando which: | |
- which php | |
- which java | |
Apache | |
Ativar o mod_rewrite do apache: | |
- sudo a2enmod rewrite | |
Para fazer o mod_rewrite funcionar completamente talvez seja preciso alterar o AllowOverride None para All: | |
<Directory /> |
<?php | |
$a = 1.01; + | |
$b = '1.1'; | |
echo bcadd($a, $b, 2); | |
echo "</br>"; | |
$first = bcsub('1000', 333.33, 2); | |
echo $first . '</br>'; |
<?php | |
static function dataToString($set, $input, $key_type = 'number') { | |
if($key_type === 'number') { | |
return isset($set[intval($input)]) ? $set[intval($input)] : ''; | |
} else { | |
return isset($set[$input]) ? $set[$input] : ''; | |
} | |
} |
Verifique aqui se seu browser é compatível com determinadas propriedades do flexbox, já que novas propriedades vão aos poucos sendo implementadas
Flexbox é uma coleção de propriedades CSS usadas para alinhar conteúdo e distribuição de espaço.
Flexbox adiciona flex containers, flex items, e flex lines além de novas propriedades: