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
https://stackoverflow.com/a/50918688 | |
https://stackoverflow.com/a/39608906 |
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
git reset --hard HEAD~1 | |
git push origin HEAD --force | |
Fonte: https://pt.stackoverflow.com/a/128580 |
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
import java.io.*; | |
import java.text.DecimalFormat; | |
public class Media { | |
private static Double n1 = 0.0, n2 = 0.0, n3 = 0.0, n4 = 0.0, media = 0.0; | |
public static void main(String[] args) { | |
try { |
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
SELECT | |
TRIM(BOTH ';' FROM CONCAT_WS(';',`u`.`email`,`u`.`other_email`)) as emails, | |
`u`.`nome` | |
FROM | |
desk_20.`users` AS `u` | |
WHERE | |
(u.id_role = 2)# Admins | |
AND (u.status = 1) | |
AND (u.deleted = 0); |
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
UPDATE desk_24.fases_processuais fp1 | |
INNER JOIN desk_24.fases_processuais fp2 ON(fp2.id = fp1.id) | |
SET fp1.resumos = IF(fp2.resumos IS NULL,'13,14,15,16,17,18,19',CONCAT(fp2.resumos, ',13,14,15,16,17,18,19')) | |
WHERE fp1.id IN(90,91,92); |
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 @id_escritorio := '18'; | |
SET @query1 = CONCAT('SELECT * FROM escritorio_', @id_escritorio,'.banco ORDER BY id_banco DESC'); | |
PREPARE stmt1 FROM @query1; | |
EXECUTE stmt1; | |
DEALLOCATE PREPARE stmt1; |
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
(function () { | |
showCardId(); | |
countCardsByList(); | |
})(); | |
function showCardId() { | |
var cards_id = document.querySelectorAll('.card-short-id'); | |
for (var i=0; i < cards_id.length; i++) { | |
id = cards_id[i].textContent; |
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
(function () { | |
// Window ready event in pure JS | |
window.addEventListener('load', ready, false); | |
function ready () { | |
changeNum(7); | |
} | |
function changeNum (num = 1) { |
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
$(document).on('keypress', '.telefones', function () { | |
applyMask(); | |
}); | |
function applyMask(){ | |
$('.telefones').each(function(index, elem){ | |
var fone = $(this).val(); | |
fone = fone.replace(/\D/g, ''); | |
if (fone.slice(0,4) == '0800') { | |
$(this).unmask(); |
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
# Database size of data + indexes | |
SELECT | |
SUM((DATA_LENGTH + INDEX_LENGTH)) db_bytes, | |
ROUND(SUM((((DATA_LENGTH + INDEX_LENGTH) / 1024) / 1024)), 2) AS db_mb, | |
ROUND(SUM((((DATA_LENGTH + INDEX_LENGTH) / 1024) / 1024) / 1024), 2) AS db_gb | |
ROUND(SUM((DATA_LENGTH + INDEX_LENGTH) / 1073741824), 2) AS db_gb2 | |
FROM | |
INFORMATION_SCHEMA.PARTITIONS | |
WHERE | |
TABLE_SCHEMA = 'db_store_122'; |