Skip to content

Instantly share code, notes, and snippets.

https://github.com/brave/brave-browser/issues/824#issuecomment-501191952
document.getElementsByTagName('video')[0].requestPictureInPicture();
@thiagoaag
thiagoaag / run_docker_with_war
Created May 10, 2019 12:32
Run local docker with deploy webapp
# TOMCAT
docker run -v {absolute_path}/{war_package}.war:/usr/local/tomcat/webapps/{name_of_package}.war -it -p 8080:8080 tomcat
# Path to resources
http://localhost:8080/{name_of_package}
@thiagoaag
thiagoaag / Credit Card Generator
Created November 19, 2018 19:10 — forked from B-Con/Credit Card Generator
This JavaScript function generates random number strings that pass the Luhn checksum, the test that credit card numbers must conform to. It assumes there is an HTML radio input to indicate which company issued the card. This code is from my webpage here: http://bradconte.com/cc_generator.html.
// Copyright (c) 2015, Brad Conte (http://bradconte.com)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
@thiagoaag
thiagoaag / mvn_release_fail_prepare
Last active November 27, 2017 20:03
mvn_release_fail_prepare
caso de falha
mvn release:prepare
- voltar branch para commit anterior ao command
- força a atulização 'git push -f'
- apagar a tag local
- tag -d [nome da tag]
- apagar o arquivo 'release.prepare'
@thiagoaag
thiagoaag / kafka_command_lines.sh
Created November 8, 2017 17:43
kafka_command_line_tests
# producer
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic [topic name] --property "parse.key=true" --property "key.separator=:"
# consumer
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic [topic name] --from-beginning
@thiagoaag
thiagoaag / update_project_mvn
Last active June 28, 2019 12:26
Update the maven project version without pom backup files
mvn versions:set -DnewVersion=[new version] -DgenerateBackupPoms=false
@thiagoaag
thiagoaag / tab-navigation-semanticUi.html
Last active March 9, 2016 16:48
Tab navigation SemanticUI
$(document).ready(function() {
//$('.item').tab();
$('.item')
.on('click', function() {
if( !$(this).hasClass('disabled') ){
$.tab('change tab', $(this).data("tab") );
}
});
public static string TruncateAtWord(this string input, int length)
{
if (input == null || input.Length < length)
return input;
int iNextSpace = input.LastIndexOf(" ", length);
return string.Format("{0}...", input.Substring(0, (iNextSpace > 0) ? iNextSpace : length).Trim());
}
http://stackoverflow.com/a/1614090
@thiagoaag
thiagoaag / NavigationBehavior.html
Last active October 21, 2015 17:49
Navigating in the list by arrows keyboard
<html>
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
$( window ).load(function() {
window.index = -1;