-
Pense em qualquer número de DOIS dígitos, por exemplo 47
-
Subtraia a soma dos algarismos. Ex.: 47 - (4 + 7) = 36
-
Depois some os algarismos resultantes da subtração anterior, adicionando 4. Ex.: 3 + 6 + 4 = 13
-
Multiplique o resultado pelo inverso do número. Ex.: 13 x 31 = 403
-
E por último, multiplique por 3 o resultado anterior. Ex. 403 x 3 = 1209
-
Obs.: Qualquer número de 2 algarismos (entre 10 e 99) terão o mesmo resultado.
-
Não acredita ? Faça o teste !!!!
This file contains hidden or 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
Transformar uma string em outra na qual cada letra do alfabeto deve ser a proxima mantendo o resto igual. ex: a -> b, z -> a, f -> g. | |
Após a transformação gerar uma nova string onde toda vogal deve ser maiúscula. | |
exemplos: | |
Input:"hello*3" | |
Output:"Ifmmp*3" | |
Input:"fun times!" |
This file contains hidden or 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 verificarCidadeAtendida (nomeCidade) { | |
var nomeCidadeLower = nomeCidade && nomeCidade.toLowerCase(), | |
cidadesAtendidas = service.obterListaCidadesAtendidas(); | |
var encontrarCidadeLowerCase = R.pipe( | |
R.map(R.toLower), // Põe todas as cidades em lowercase | |
R.any(R.equals(nomeCidadeLower)) // Busca por qualquer (any) cidade correspondente à pesquisa | |
); | |
var encontrouCidade = encontrarCidadeLowerCase(cidadesAtendidas); |
This file contains hidden or 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 (angular) { | |
angular | |
.module('project.directives') | |
.directive('input', input); | |
// Monkey patch para problema de máscara nos telefone samsung da série 6 | |
function input($timeout) { | |
return { | |
restrict: 'E', |
This file contains hidden or 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 | |
function logMsg( $msg, $level = 'info', $file = 'main.log' ) | |
{ | |
// variável que vai armazenar o nível do log (INFO, WARNING ou ERROR) | |
$levelStr = ''; | |
// verifica o nível do log | |
switch ( $level ) | |
{ |
This file contains hidden or 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
$http | |
.get("http://ipinfo.io", { jsonp: true } ) | |
.then(function(response) { | |
var countryCode = (response.data && response.data.country) ? response.data.country : ""; | |
}); |
O comando abaixo grava a tela do celular por 10 segundos e cria um arquivo dentro do celular
adb.exe shell screenrecord /sdcard/example.mp4 --time-limit 10 --verbose
O comando abaixo salva a tela do celular e salva o arquivo da imagem no PC
adb.exe exec-out screencap -p > screen.png
This file contains hidden or 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 | |
function logMsg( $msg, $level = 'info', $file = 'main.log' ) { | |
// variável que vai armazenar o nível do log (INFO, WARNING ou ERROR) | |
$levelStr = ''; | |
// verifica o nível do log | |
switch ( $level ) | |
{ | |
case 'info': | |
// nível de informação |
This file contains hidden or 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 | |
$app->hook('slim.before.router', function () use ($app) { | |
$api_key = $app->request->headers('Api-Key'); | |
if ($api_key == '' && strlen($app->request->getBody()) == 0 ) { | |
$app->halt(200, '"CORS OK"'); | |
} else { |
This file contains hidden or 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
const Transposer = require('chord-transposer'); | |
const ncp = require("copy-paste"); | |
const cifra = ncp.paste(); | |
const result = Transposer.transpose(cifra).fromKey('G').toKey('A').toString(); | |
ncp.copy(result, () => { | |
console.log('copied!'); | |
}); |