Skip to content

Instantly share code, notes, and snippets.

View lramosduarte's full-sized avatar
:octocat:
Working

Leonardo Ramos Duarte lramosduarte

:octocat:
Working
  • Minas Gerais
View GitHub Profile
@lramosduarte
lramosduarte / config.js
Created July 26, 2016 18:36
Configuração PT-BR datePicker materialize-css
var diaSemana = [ 'Domingo', 'Segunda-Feira', 'Terca-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sabado' ];
var mesAno = [ 'Janeiro', 'Fevereiro', 'Marco', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro' , 'Dezembro' ];
var data = new Date();
var hoje = diaSemana[data.getDay()] + ', ' + mesAno[data.getMonth()] + ' de ' + data.getFullYear();
$("#dataPesquisa").attr("value", hoje);
$(".datepicker").pickadate({
monthsFull: mesAno,
monthsShort: [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ],
weekdaysFull: diaSemana,
weekdaysShort: [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab' ],
@lramosduarte
lramosduarte / CustomFormatter python3 - Return string to format with replacement fields not used in string.txt
Last active June 15, 2017 16:57
CustomFormatter python3 - Return string to format with replacement fields not used in string
import string
class PartialFormatter(string.Formatter):
def get_field(self, field_name, args, kwargs):
try:
val=super().get_field(field_name, args, kwargs)
except (KeyError, AttributeError):
val = '{{{nome_campo}}}'.format(nome_campo=field_name),field_name
return val
@lramosduarte
lramosduarte / GPGKeys.md
Last active March 9, 2019 23:49
Basic uses for GPG-Keys

GPG keys

Create

Todo

Update expire date public key

@lramosduarte
lramosduarte / timming.py
Created November 24, 2017 15:47
timming functions python
def tempo_executar_funcao(f):
def wrap(*args):
time1 = time.time()
ret = f(*args)
time2 = time.time()
# alterar se for python3 o print e nome de funcao
print '%s function took %0.3f ms' % (f.func_name, (time2-time1)*1000.0)
return ret
@lramosduarte
lramosduarte / usefull.md
Created February 24, 2018 19:55
Commands bash and git usefull

Remove migrations django not commiteds

rm **/migrations/00** && git checkout $(git ls-files -m | grep migrations/00)
@lramosduarte
lramosduarte / lista-de-nacionalidade.txt
Created December 11, 2019 19:44 — forked from lpirola/lista-de-nacionalidade.txt
Lista de países em português com suas respectivas nacionalidades
Antígua e Barbuda - Antiguano
Argentina - Argentino
Bahamas - Bahamense
Barbados - Barbadiano, barbadense
Belize - Belizenho
Bolívia - Boliviano
Brasil - Brasileiro
Chile - Chileno
Colômbia - Colombiano
Costa Rica - Costarriquenho
@lramosduarte
lramosduarte / How to
Created February 19, 2021 11:34
Using Jshell like a pro(or newbie if wanna)
# Extract jar files
```bash
$: jar xf JAR_FILE.jar
```
## Check files
File structure containing the application's dependencies.
# Running
```bash
$: CLASSPATH="PATH1:PATH2" jshell
@lramosduarte
lramosduarte / keybase.md
Created August 17, 2022 14:19
keybase.md

Keybase proof

I hereby claim:

  • I am lramosduarte on github.
  • I am leonardoduarte (https://keybase.io/leonardoduarte) on keybase.
  • I have a public key ASCvpz43WeIHglyNUvAJlz-fBr8AIyJo55L7bCym9e5H3Ao

To claim this, I am signing this object:

@lramosduarte
lramosduarte / keycloak-openapi.yaml
Last active March 14, 2024 13:51
Keycloak - OpenAPI - Mock - TokenFlow - WIP
openapi: 3.0.3
info:
title: Swagger Petstore - OpenAPI 3.0
description: |-
Keycloak mock api
Some useful links:
- [keycloak doc](https://www.keycloak.org/docs/23.0.7/authorization_services/)
- [keycloak postman collection](https://documenter.getpostman.com/view/7294517/SzmfZHnd#12b1b64f-372b-47b5-a01f-0418fd9515c4)