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 / clean-maven-repository-folder.sh
Last active May 23, 2018 14:53
Shell script to clean old dependencies from Maven repositories in Linux computers. Downloaded dependencies for more than 30 days is deleted. Code based on: http://stackoverflow.com/a/29970448
#!/usr/bin/env bash
find ~/.m2 -atime +30 -iname '*.pom' | while read pom; do parent=`dirname "$pom"`; rm -Rf "$parent"; done;
find ~/.m2 -empty -type d -delete;

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)

@gustavomdsantos
gustavomdsantos / SBC_template.md
Last active January 17, 2023 03:01
Template de estilo em CSS para documentos em Markdown seguindo parcialmente os padrões da SBC.
<style> h1, h2, h3, h4, p, th, td, li, center {font-family: Times} th { background-color: #E9E9E9; } h1, .markdown-preview[data-use-github-style] h1 {text-align: center; font-size: 16pt;} h2, .markdown-preview[data-use-github-style] h2 {font-size: 14pt;} h3, .markdown-preview[data-use-github-style] h3 {font-size: 13pt;} h4, .markdown-preview[data-use-github-style] h4 {font-size: 12pt;} p {text-align: justify; font-size: 12pt;} </style>
<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
<table border="0" cellpadding="0" width="450" style="table-layout:fixed; text-size-adjust: none !important; -ms-text-size-adjust: none !important; -webkit-text-size-adjust: none !important;
">
<tbody>
<tr>
<td align="left" valign="top" width="80">
<p style="margin-right: 10px; font-family: Helvetica, Arial, sans-serif; font-size: 12px; line-height: 14px; margin-bottom: 10px;">
<a style="text-decoration:none" href="https://about.me/gustavosotnas">
<img style="object-fit: none; object-position: center; height: 72px; width: 72px; border-radius: 50%;" src="https://pt.gravatar.com/userimage/101482200/528d595f1442d3fe59f8ab4ba75eb0fa.jpg?size=72" alt="Gustavo Moraes" data-pin-nopin="true">
</a>
@gustavomdsantos
gustavomdsantos / import_beatport-to-spotify_playlist.csv
Last active November 7, 2016 12:54
Padrão de CSV para importar playlists do Beatport para Spotify via soundiiz.com - [Nome da música, Artista, Álbum (opcional)]
Hallelujah Anyway - Larse Vocal Candi Staton Hallelujah Anyway
Alone - Rocco Deep Mix Liquideep
@gustavomdsantos
gustavomdsantos / beatport_export_button_snippet.html
Last active December 30, 2022 01:01
User script que exporta tracklists do Beatport para CSV.
<span class="value" style="margin-right: 0px;">
<a>Export playlist</a>
</span>
@gustavomdsantos
gustavomdsantos / block-soundsnap-waterwark.txt
Created November 17, 2016 16:47
Block SoundSnap Audio Waterwark using AdBlock Plus! Just add this rule in your filter list (Options > Add your own filters).
http://www.soundsnap.com/files/soundsnap_watermark*.mp3
@gustavomdsantos
gustavomdsantos / static-method.coffee
Last active March 26, 2017 13:43
Variáveis e funções estáticas no CoffeeScript existem, e na documentação da linguagem (http://coffeescript.org) não tem isso especificado. Abaixo está um exemplo básico disso.
# Acesso estático
class Pessoa
getNome: () ->
return "nome";
@getIdade: () ->
return 36
a = new Pessoa()
@gustavomdsantos
gustavomdsantos / Formas de Criar View em CoffeeScript.coffee
Last active June 26, 2017 20:21
Exemplos de código-fonte em CoffeeScript para Backbone.JS
define [
"jquery"
"underscore"
"backbone"
], ($, _, Backbone) ->
class MinhaView1 extends Backbone.View
el: '.page'
render: ->
@
@gustavomdsantos
gustavomdsantos / enum.coffee
Created May 25, 2017 18:12
Não existem enums em CoffeeScript/JavaScript (é inútil um conceito desses em linguagens dinâmicas), mas é possível fazer um artifício para se ter um objeto cujos valores de atributos são constantes (imutáveis). Fonte: https://stackoverflow.com/a/32450001
Colors = Object.freeze
RED: 'red'
GREEN: 'green'
BLUE: 'blue'
console.log Colors.RED
Colors.RED = 'black' # it won't change (constant value)
console.log Colors.RED