Skip to content

Instantly share code, notes, and snippets.

View Lecarvalho's full-sized avatar
🐍

Leandro Carvalho Lecarvalho

🐍
View GitHub Profile
@Lecarvalho
Lecarvalho / RandomWordsWidget.dart
Last active May 28, 2019 17:18
RandomWordState with first load and no rebuild the starter state after setState() invoked
import 'package:english_words/english_words.dart';
import 'package:flutter/material.dart';
class RandomWords extends StatefulWidget {
@override
RandomWordsState createState() => new RandomWordsState();
}
class RandomWordsState extends State<RandomWords> {
@Lecarvalho
Lecarvalho / Program.cs
Created September 15, 2019 12:44
configuration .netcore use url
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://localhost:5001/");
@Lecarvalho
Lecarvalho / iconbutton_reddot_notification_widget.dart
Created October 5, 2019 11:43
Icon with a red dot to presume a notification
import 'package:flutter/material.dart';
class IconButtonRedDotNotificationWidget extends StatelessWidget {
final IconData icon;
final Function onTap;
IconButtonRedDotNotificationWidget(this.icon, {this.onTap});
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
@Lecarvalho
Lecarvalho / mklink
Created October 29, 2019 10:48
mirror bigfiles to another disk
@Lecarvalho
Lecarvalho / dynamic_size.dart
Created December 5, 2019 08:19
A class to help in adaptation of the sizes for widgets, texts, images, etc, on different screen sizes. In my case it uses a base designWidth = 411 because this is the width for my device used for development. Check yours with your designer or in your sketch / prototype.
import 'package:flutter/material.dart';
class DynamicSize {
MediaQueryData _mediaQuery;
static const double _designWidth = 411;
DynamicSize._constructor();
static final DynamicSize instance = DynamicSize._constructor();
@Lecarvalho
Lecarvalho / copy-sqlite-db-android-to-pc.cmd
Created December 21, 2019 16:54
Copiando arquivo .db de um app Android no seu desktop
cd C:\PastaQualquer
adb shell
run-as id-do-seu-app
cd databases
ls
cp nome-do-arquivo.db /sdcard/nome-do-arquivo.db
exit
exit
adb pull /sdcard/nome-do-arquivo.db
@Lecarvalho
Lecarvalho / save_credentials_git_linux.file
Created December 31, 2019 16:54
save credential git linux
git config --global credential.helper cache
@Lecarvalho
Lecarvalho / git_reate_and_push_existant_repo.cmd
Last active May 29, 2021 12:23
After creating the new repo, we just want to push the existant files to git
git init &&
git add . &&
git commit -m "first commit" &&
git branch -M main &&
git remote add origin url.git &&
git push -u origin main
@Lecarvalho
Lecarvalho / gist:74bceb22e85005291f1912fea1874614
Created August 26, 2020 22:05
revert a modified file from a pull-request - ex: dev web.config :D
git checkout pull-request-branch
git checkout origin/master -- src/main/java/HelloWorld.java
git commit -m "revert a modified file from pull request"
git push origin pull-request-branch
@Lecarvalho
Lecarvalho / add_env_var_zsh.sh
Created May 17, 2021 11:49
add env variable zsh
$ echo 'export ENV_VAR=12345' >> ~/.zshenv
echo $ENV_VAR