Skip to content

Instantly share code, notes, and snippets.

View samuelematias's full-sized avatar

samuca samuelematias

View GitHub Profile
@samuelematias
samuelematias / carousel_without_transition.dart
Last active November 16, 2020 20:25
A simple Carousel widget without Transition for Flutter apps.
@samuelematias
samuelematias / Install_tmux
Created October 27, 2020 21:20 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@samuelematias
samuelematias / README.md
Created October 27, 2020 12:41 — forked from kasperpeulen/README.md
How to get a timestamp in Dart.
@samuelematias
samuelematias / IsBoolNumber.swift
Last active October 9, 2020 20:31
How handle bool values coming as NSNumber. More about: https://en.it1352.com/article/6f2bc8b44b4846bb80e09201f4acb25e.html
func isBoolNumber(_ num: NSNumber) -> Bool {
let boolID = CFBooleanGetTypeID() // the type ID of CFBoolean
let numID = CFGetTypeID(num) // the type ID of num
return numID == boolID
}
@samuelematias
samuelematias / dart_enum_description.dart
Created September 15, 2020 14:09 — forked from rodydavis/dart_enum_description.dart
Add Descriptions to Enums in Dart
enum MyEnum {
simple,
special,
complex,
}
extension MyEnumUtils on MyEnum {
String get description {
switch (this) {
case MyEnum.simple:
@samuelematias
samuelematias / unused_dependencies.js
Created September 4, 2020 14:49 — forked from lukepighetti/unused_dependencies.js
Search a Flutter project for unused dependencies
/// Finds unused dependencies from pubspec.yaml
///
/// Achieves this by parsing pubspec.yaml and recursively
/// searching the lib folder for an import statement that
/// contains the name of each package. Prints out the results.
const fs = require("fs");
const YAML = require("yaml");
const { execSync } = require("child_process");
/// Read pubspec.yaml
@samuelematias
samuelematias / links.md
Created August 26, 2020 15:34 — forked from irvine5k/links.md
TDC SP 2020 TESTES DE WIDGET
@samuelematias
samuelematias / animated_line_progress.dart
Created August 20, 2020 16:36
Line Progress Animated.
import 'package:flutter/material.dart';
class AnimatedLineProgress extends StatelessWidget {
final double minLineWidth;
final double maxLineWidth;
final double minLineHeight;
final double maxLineHeight;
final Color lineColor;
final double progressValue;
final Color progressColor;
include: all_lint_rules.yaml
analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
# This is generated from the i18n vscode extension
- "**/i18n.dart"
strong-mode:
implicit-casts: false
implicit-dynamic: false
linter:
rules:
- always_declare_return_types
- always_put_control_body_on_new_line
- always_put_required_named_parameters_first
- always_require_non_null_named_parameters
- always_specify_types
- annotate_overrides
- avoid_annotating_with_dynamic
- avoid_as