Skip to content

Instantly share code, notes, and snippets.

View gustavomdsantos's full-sized avatar
👨‍💻
Working as an IT manager

Gustavo Moraes gustavomdsantos

👨‍💻
Working as an IT manager
  • Universidade Federal de Goiás
  • Brasília, Distrito Federal
View GitHub Profile
@gustavomdsantos
gustavomdsantos / avd-launcher-get-version_package-manager.sh
Last active December 22, 2015 22:46
[avd-launcher] Trechos de código e de artefatos para uma próxima versão do AVD Launcher https://github.com/gustavosotnas/avd-launcher
#! /bin/bash
# Author: Gustavo Moraes <gustavosotnas1@gmail.com>
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file COPYING in the main directory of this archive
# for more details.
# Script para obter o número da versão do AVD Launcher.
#
@gustavomdsantos
gustavomdsantos / Cucumber-Exemplo-SysRadoc.feature
Last active February 25, 2016 19:00
Repositório de exemplos de especificação de requisitos executável - uma funcionalidade do sistema SysRadoc, em linguagem Gherkin, do Cucumber.
#language: pt
# Template de especificação executável em linguagem Gherkin/Cucumber
# Author: Gustavo Moraes <gustavosotnas1@gmail.com>
#
# Artigos sobre a linguagem Gherkin/Cucumber:
# http://elemarjr.net/2012/04/12/bdd-na-prtica-parte-3-gherkin
# http://pt.slideshare.net/edumendes/bdd-com-cucumber-14910137
#
# A ferramenta Cucumber é originalmente feita para Ruby, mas pode usada
@gustavomdsantos
gustavomdsantos / .gitignore-for-Android-Studio-projects
Created March 15, 2016 18:37
An adaptation of github/gitignore/Android.gitignore file with '.idea' folder being ignored. To use on your Android Studio project, download and rename it to ".gitignore".
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
@gustavomdsantos
gustavomdsantos / [Android] Stop recreating Activity on orientation change _ androidmanifest.xml
Created March 17, 2016 23:42
'androidmanifest.xml' snippet to better support both Landscape and Portrait mode, without recreating activity again. Link: http://stackoverflow.com/a/28718002
<activity
android:configChanges="keyboardHidden|orientation|screenSize"
android:name=".testActivity"
android:label="@string/app_name">
</activity>
@gustavomdsantos
gustavomdsantos / restore-gitlab-backup-files.sh
Last active May 6, 2016 13:56
Script que ajuda a restaurar backups no GitLab, resolvendo problemas de permissões de arquivos no GitLab, entre outros (comandos obtidos da saída do comando ´sudo gitlab-rake gitlab:check SANITIZE=true` e http://doc.gitlab.com/ce/raketasks/backup_restore.html#omnibus-installations)
#! /bin/bash
APP_NAME="Restore GitLab Backup Files by gustavosotnas"
# Author: Gustavo Moraes <gustavosotnas@gmail.com>
#
# Solution based in GitLab's official tutorial to restore backups:
# http://doc.gitlab.com/ce/raketasks/backup_restore.html#omnibus-installations
# (This script applies to GitLab installations from official .deb package!)
#
# To backup a GitLab repository server, simply run this command:
@gustavomdsantos
gustavomdsantos / ReadFileToString.java
Last active May 11, 2016 00:20
The simplest way to read a file to String in Java, based on http://stackoverflow.com/a/3403112
private static String readFile(String filename) throws FileNotFoundException {
return new Scanner(new File(filename)).useDelimiter("\\Z").next();
}
@gustavomdsantos
gustavomdsantos / detectPyVersion.py
Created May 12, 2016 11:48
Um código para Python 3+ de exemplo com codificação UTF-8 e mensagem que detecta versão do Python.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if sys.version_info[0] < 3:
print ("Está usando Python 2 né? Atualiza logo!")
else:
print ("Está usando Python 3, bom...")
@gustavomdsantos
gustavomdsantos / Messenger Banner Remover.user.js
Last active May 28, 2016 22:14
Greasemonkey / Tampermonkey userscript that removes that black banner ("Download App") in top of Messenger.com pages.
// ==UserScript==
// @name Messenger Banner Remover
// @version 0.1.0
// @namespace com.gustavosotnas.userjs.messengerbannerremover
// @description Removes that black banner ("Download App") in top of Messenger.com pages.
// @author Gustavo Moraes
// @copyright 2016+, Gustavo Moraes (https://github.com/gustavosotnas)
// @include https://www.messenger.com/t/*
// @require https://code.jquery.com/jquery-2.2.4.min.js
// @icon https://gist.githubusercontent.com/raw/a39afefbad5267893f6d4639ad3a4dff/messenger_banner_remover_icon.png
@gustavomdsantos
gustavomdsantos / build.xml
Created July 23, 2016 22:51
Config files for executing Java projects in Cloud9. Requires Ant and Java 8 is suggested. https://c9.io
<project name="MyJavaProject" default="dist" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build/classes"/>
<property name="dist" location="dist"/>
<target name="init">

Juros por mês

Juro por mês = valor inicial * taxa (mês) Parcela = juro por mês + (valor inicial/quantidade de parcelas - meses)

Juros por ano

Juro por ano = valor inicial * taxa (ano) Parcela = juro por ano + (valor inicial/quantidade de parcelas - anos)