Skip to content

Instantly share code, notes, and snippets.

View marcellodesales's full-sized avatar

Marcello DeSales marcellodesales

View GitHub Profile
@marcellodesales
marcellodesales / dart-concurrent-futures-google-tuples-sync.dart
Created July 17, 2021 06:47
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
// 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),
{
"$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 September 10, 2020 22:27 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

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 September 30, 2020 17:51 — forked from yancyn/git-svn.md
Migrate Archive Google Code SVN to Git using Docker

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

############################
# 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 March 6, 2019 00:46
Example of Jenkinsfile with icons for the list of parameters
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 October 17, 2018 04:50
Github Config to be at ~/.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 September 19, 2018 05:40
Generate an industry standard PKCS12 self-signed cert and setup SpringBoot to use it
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 \
#!/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
@marcellodesales
marcellodesales / Dockerfile
Last active August 27, 2018 15:46
Generic Multi-stage Dockerfile for Springboot Apps with Unit and Integration tests
# #####################################################################
# Build stage for building the target directory before running tests
# #####################################################################
FROM marcellodesales/gradle:2.13 as builder
MAINTAINER marcello.desales@gmail.com
USER root
#RUN apt-get update && apt-get install -y git