Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcello de Sales marcellodesales

View GitHub Profile
View configprops.json
{
"contexts": {
"application-1": {
"beans": {
"spring.boot.admin.ui-de.codecentric.boot.admin.server.ui.config.AdminServerUiProperties": {
"prefix": "spring.boot.admin.ui",
"properties": {
"loginIcon": "assets/img/icon-spring-boot-admin.svg",
"cache": {
"maxAge": "PT1H",
@marcellodesales
marcellodesales / dart-concurrent-futures-google-tuples-sync.dart
Created Jul 17, 2021
The example implementing the execution of concurrent Future async calls in dart synchronized by the Google's Tuple API, as described at https://stackoverflow.com/questions/42176092/dartlang-wait-more-than-one-future/67736970#67736970
View dart-concurrent-futures-google-tuples-sync.dart
// Fetch the ticket status with fee associated with it
// 2 future calls are made concurrently, so that it will be constructing the status object properly
static Future<TicketStatus> fetchTicketStatusWithFee({ required String uid, required int marketPlaceId,
required int storeId, required String ticketId }) async {
// https://stackoverflow.com/questions/42176092/dartlang-wait-more-than-one-future/67736970#67736970
// Calling both endpoints and sychronizing on them
final tupleTicketStatusAndFee = await waitConcurrently<TicketStatus, double>(
// Future<TicketSTatus> is returned on item1
fetchTicketStatus(uid: uid, marketPlaceId: marketPlaceId, storeId: storeId, ticketId: ticketId),
View resume.json
{
"$schema": "https://json.schemastore.org/resume",
"meta": { "theme": "spartan" },
"basics": {
"name": "Marcello de Sales",
"label": "The brick walls are there to give us the chance to show how badly we want something.",
"image": "",
"email": "marcello.desales@gmail.com",
"phone": "",
"url": "",
@marcellodesales
marcellodesales / gist:a547343403ccf6e5089f78276769cdac
Created Sep 10, 2020 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:a547343403ccf6e5089f78276769cdac

Use https://github.com/carloscuesta/gitmoji-cli

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
@marcellodesales
marcellodesales / migrate-googlecode-svn-repos-to-github-using-docker.md
Last active Sep 30, 2020 — forked from yancyn/git-svn.md
Migrate Archive Google Code SVN to Git using Docker
View migrate-googlecode-svn-repos-to-github-using-docker.md

Migrate Archive Google Code SVN to Git using Docker

The source-code and wiki pages migrated using Docker, no need to install other software

Requirements

  • git
  • docker

Result of the manual steps

View golang-cross-compile-Dockerfile
############################
# STEP 1 build executable binary
############################
# golang alpine 1.12.6
FROM golang@sha256:cee6f4b901543e8e3f20da3a4f7caac6ea643fd5a46201c3c2387183a332d989 as builder
# Install git + SSL ca certificates.
# Git is required for fetching the dependencies.
# Ca-certificates is required to call HTTPS endpoints.
RUN apk update && apk add --no-cache git ca-certificates tzdata libmagic file && update-ca-certificates
@marcellodesales
marcellodesales / Jenkinsfile
Created Mar 6, 2019
Example of Jenkinsfile with icons for the list of parameters
View Jenkinsfile
pipeline {
options {
// Build auto timeout
timeout(time: 15, unit: 'MINUTES')
}
// https://jenkins.io/doc/book/pipeline/syntax/#parameters
parameters {
choice(
@marcellodesales
marcellodesales / .gitconfig
Last active Oct 17, 2018
Github Config to be at ~/.gitconfig
View .gitconfig
[user]
name = Marcello de Sales
email = marcello.desales@gmail.com
[alias]
lol = log --pretty=oneline --abbrev-commit --graph --decorate
#lol = log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
todos = !sh -c 'git grep TODO: && git show :/TODO'
lg = log --color --graph --pretty=format:'%C(yellow)%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
reflog = gitk --all --date-order $(git log -g --pretty=%H)
@marcellodesales
marcellodesales / 1.spring-boot-tls-self-signed-cert.log
Last active Sep 19, 2018
Generate an industry standard PKCS12 self-signed cert and setup SpringBoot to use it
View 1.spring-boot-tls-self-signed-cert.log
Ref1: https://drissamri.be/blog/java/enable-https-in-spring-boot/
Ref2: https://stackoverflow.com/questions/13578134/how-to-automate-keystore-generation-using-the-java-keystore-tool-w-o-user-inter/13578480#13578480
1. Generate the cert
$ keytool -genkey -noprompt -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650 \
-alias springboot \
-dname "CN=App-Name, OU=Org-Unit, O=\"Company, inc.\", L=San Diego, ST=California, C=US" \
-keystore tls.p12 \
-storepass 123456 \
View bash.generate.random.alphanumeric.string.sh
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1