Adicionar configuracao no arquivo my.config
vi /etc/my.cnf
[mysqld]
innodb_force_recovery = 2
@echo off | |
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
::this also support calls that contains a absolute windows path | |
::check of one of the params contain a absolute windows path | |
echo.%* | findstr /r /c:"[a-z]:[\\/]" > nul | |
if %errorlevel% == 1 ( | |
::if not just git with the given parameters | |
call :git %* |
SELECT * FROM wp_posts | |
LEFT JOIN wp_term_relationships ON | |
(wp_posts.ID = wp_term_relationships.object_id) | |
LEFT JOIN wp_term_taxonomy ON | |
(wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) | |
WHERE wp_posts.post_type = 'post' | |
AND wp_term_taxonomy.taxonomy = 'category' | |
AND wp_term_taxonomy.term_id = 48 | |
ORDER BY post_date DESC |
When building an adnroid app, you might stumble upon this error: | |
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE...`. Here's how to fix it: | |
That's because the app you're trying to test was already installed on the device and the signatures are different now, so it's complaining. The full error will look like something like this: | |
`Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.example signatures do not match the previously installed version; ignoring!` | |
You can see that the package ID is `com.example`, well, simply run this command: |
<?php | |
function validaCPF($cpf) { | |
// Extrai somente os números | |
$cpf = preg_replace( '/[^0-9]/is', '', $cpf ); | |
// Verifica se foi informado todos os digitos corretamente | |
if (strlen($cpf) != 11) { | |
return false; |
/** | |
* Chunkify | |
* Google Chrome Speech Synthesis Chunking Pattern | |
* Fixes inconsistencies with speaking long texts in speechUtterance objects | |
* Licensed under the MIT License | |
* | |
* Peter Woolley and Brett Zamir | |
*/ | |
var speechUtteranceChunker = function (utt, settings, callback) { |
var d = new Date(); | |
d = new Date(d.getTime() - 3000000); | |
var date_format_str = d.getFullYear().toString()+"-"+((d.getMonth()+1).toString().length==2?(d.getMonth()+1).toString():"0"+(d.getMonth()+1).toString())+"-"+(d.getDate().toString().length==2?d.getDate().toString():"0"+d.getDate().toString())+" "+(d.getHours().toString().length==2?d.getHours().toString():"0"+d.getHours().toString())+":"+((parseInt(d.getMinutes()/5)*5).toString().length==2?(parseInt(d.getMinutes()/5)*5).toString():"0"+(parseInt(d.getMinutes()/5)*5).toString())+":00"; | |
console.log(date_format_str); | |
//2015-03-31 13:35:00 |
Git freak como sou, precisava compartilhar algo útil sobre ele, claro. E, já que não vejo muito por aí o pessoal usando, resolvi falar dos alias do git! É um recurso que eu uso muito, e nunca entendi porque muitas pessoas não são adeptas. 😕
Pelo nome você já deve perceber que os alias no git são atalhos. Atalhos pro quê? São atalhos para comandos do git e até comandos shell se você quiser. E é bem fácil cadastrar um alias:
$ git config --global alias.st status
// moment.js locale configuration | |
// locale : brazilian portuguese (pt-br) | |
// author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira | |
(function (factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(['moment'], factory); // AMD | |
} else if (typeof exports === 'object') { | |
module.exports = factory(require('../moment')); // Node | |
} else { |