Skip to content

Instantly share code, notes, and snippets.

View luiz158's full-sized avatar

Luiz Augusto luiz158

  • Curitba/PR - Brasil
View GitHub Profile
@luiz158
luiz158 / CurrencyPtBrInputFormatter.dart
Created March 11, 2023 15:51 — forked from andre-bahia/CurrencyPtBrInputFormatter.dart
Flutter TextInputFormatter Currency pt_BR
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
class CurrencyPtBrInputFormatter extends TextInputFormatter {
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
if(newValue.selection.baseOffset == 0){
return newValue;
}
#!/bin/sh
if (( $# != 2))
then
echo "Usage: md2pdf.sh <input.md> <output.pdf>"
exit 1
fi
markdown $1 | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > $2
@luiz158
luiz158 / markdown-to-pdf.txt
Created March 11, 2023 14:45 — forked from davisford/markdown-to-pdf.txt
Convert Markdown to PDF
$ brew install markdown htmldoc
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf>
@luiz158
luiz158 / vscode_editor_snippet
Created January 23, 2023 11:08 — forked from fredgrott/vscode_editor_snippet
flutter dart vscode editor settings snippet
"settings": {
//dartcode
"debug.openDebug": "openOnDebugBreak",
"debug.internalConsoleOptions": "openOnSessionStart",
//dartcode, we have two places to set one for non-editor and one for dart.editor
// screenshot is for mobile, I use device preview instead
"dart.flutterScreenshotPath": null,
"dart.devToolsTheme": "dark",
"dart.flutterCreateOrganization": "io.github.fredgrott",
"dart.previewFlutterUiGuides": true,
@luiz158
luiz158 / workspace.code-workspace
Created January 23, 2023 11:07 — forked from fredgrott/workspace.code-workspace
vscode editor settings for Flutter app development
"folders": [
{
// in multi-workspace setups this would specify the different
// workspace folders via multiple path blocks
"path": ".."
}
],
"settings": {
//dartcode
@luiz158
luiz158 / extensions.json
Created January 23, 2023 10:48 — forked from fredgrott/extensions.json
vscode extensions json file
{
"recommendations": [
"davidlday.languagetool-linter",
"adamvoss.vscode-languagetool",
"valentjn.vscode-ltex",
"eamodio.gitlens-insiders",
"yzhang.markdown-all-in-one",
"bierner.markdown-preview-github-styles",
"dart-code.dart-code",
"dart-code.flutter",
@luiz158
luiz158 / lerp_dates.dart
Created January 7, 2023 19:16 — forked from SushanShakya/lerp_dates.dart
Program on How to Interpolate Dates in Dart (Flutter)
void main() {
final firstDate = DateTime.parse('2020-10-25');
final lastDate = DateTime.parse('2020-12-10');
int x = firstDate.microsecondsSinceEpoch;
int y = lastDate.microsecondsSinceEpoch;
final List<DateTime> dates = [];
final totalDatesRequired = 4;
@luiz158
luiz158 / clean_code.md
Created January 6, 2023 12:50 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@luiz158
luiz158 / analysis_options.yaml
Created January 2, 2023 19:20 — forked from rydmike/analysis_options.yaml
RydMike lints v2.0.0 - Personal preferences and my starting point for my Dart & Flutter linter rules setup
# RydMike LINTER Preferences v2.0.0
#
# Get this file here: https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
#
# We include and activate all lint rules, later below we disable the not used or desired ones.
# You can find a list of all lint rules to put in your all_lint_rules.yaml file here:
# https://dart-lang.github.io/linter/lints/options/options.html
#
# For a full comparison of all lint rules settings in rule styles listed below, please see this
# sheet: https://docs.google.com/spreadsheets/d/1Nc1gFjmCOMubWZD7f2E4fLhWN7LYaOE__tsA7bf2NjA
#!/bin/bash
flutter clean
rm -rf $FLUTTER_ROOT/.pub-cache
rm -rf $HOME/Library/Caches/CocoaPods
rm -rf ios/Pods
rm -rf ios/build
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/
rm -rf ~/Library/Caches/com.apple.dt.Xcode/