Skip to content

Instantly share code, notes, and snippets.

View marcoslimagon's full-sized avatar

Marcos Lima marcoslimagon

  • Nubank
  • Campinas - SP - BR
View GitHub Profile
@marcoslimagon
marcoslimagon / lazy_widget.dart
Last active February 15, 2026 02:20
Dart Lazy widget
import 'package:flutter/widgets.dart';
import 'dart:async';
/// Builder for a widget with no build context (used by [LazyWidget]).
typedef LazyWidgetBuilder = Widget Function();
/// A widget that shows [initialWidget] until [delay] has passed, then
/// switches to [delayedWidget].
///
/// If [delay] is [Duration.zero], [delayedWidget] is shown immediately
@marcoslimagon
marcoslimagon / find_releases_with_given_commit_in_a_file.sh
Last active December 28, 2024 11:35
This scripts checks which releases contains a specific commit SHA in the top of the tree for a given file
# Requirements:
# git tag --contains <commit-sha> is not enough because it won't check file by file ensuring the history of a given file
# this script evaluates tag by tag and check the history of the file, ensure a given commit SHA is on top of the history
# (hence it is "shipped" when released under a certain tag).
#
# - gh (brew install gh)
# - jq version 1.6
# run inside your repo folder
# ensure you have the most recent version of your repo and its tags: # git fetch --tags
@marcoslimagon
marcoslimagon / clojure.clj
Created February 2, 2023 18:51
Clojure hasmap-flatten
(s/defn ^:private coll->indexed-map
"This function creates a hashmap structure based on a collection where
the key is an integer associated with given collection index.
Example:
(coll->indexed-map [\"a\", \"b\", \"c\"])
;=>
{
0 \"a\"
1 \"b\"
2 \"c\"
@marcoslimagon
marcoslimagon / deployment.yaml
Last active August 2, 2022 12:16
Creating a fake host into kubernetes and routing to a given pod using istio virtual services
apiVersion: apps/v1
kind: Deployment
metadata:
name: curlapp
spec:
selector:
matchLabels:
app: curlapp
template:
metadata:
@marcoslimagon
marcoslimagon / gist:8fa7a478bd87051d4d0c26d70637f4e5
Last active May 6, 2021 04:15
Javascript: extracting cookie names with JS
document.cookie.replace(/(?<=\=)(.*?)(?=(\;|$))/g,'').replace(/\=;/g,'\n');