Skip to content

Instantly share code, notes, and snippets.

Avatar
🧩
Taking care of my mental health and in spare moments coding sometimes.

Samuel Matias samuelematias

🧩
Taking care of my mental health and in spare moments coding sometimes.
View GitHub Profile
@samuelematias
samuelematias / dart_extensions_methods_example_4.dart
Last active Nov 23, 2020
Dart Extensions methods example 4
View dart_extensions_methods_example_4.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@samuelematias
samuelematias / dart_extensions_methods_example_3.dart
Last active Nov 23, 2020
Dart Extensions methods example 3
View dart_extensions_methods_example_3.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
@samuelematias
samuelematias / dart_extensions_methods_example_2.dart
Last active Nov 23, 2020
Dart Extensions methods example 2
View dart_extensions_methods_example_2.dart
void main() {
final String _text = 'ExTEnSiON';
print(_text.capitalize()); //Extension
}
extension StringExtensions on String {
String capitalize() {
return "${this[0].toUpperCase()}${this.toLowerCase().substring(1)}";
}
@samuelematias
samuelematias / dart_extensions_methods_example_1.dart
Last active Nov 23, 2020
Dart Extensions methods example 1
View dart_extensions_methods_example_1.dart
void main() {
final String _text = 'ExTEnSiON';
String _capitalize(String text){
return "${text[0].toUpperCase()}${text.toLowerCase().substring(1)}";
}
print(_capitalize(_text)); //Extension
}
@samuelematias
samuelematias / carousel_with_transition.dart
Last active Nov 16, 2020
A simple Carousel widget with Transition for Flutter apps.
View carousel_with_transition.dart
@samuelematias
samuelematias / carousel_without_transition.dart
Last active Nov 16, 2020
A simple Carousel widget without Transition for Flutter apps.
View carousel_without_transition.dart
@samuelematias
samuelematias / Install_tmux
Created Oct 27, 2020 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
View Install_tmux
# 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 Oct 27, 2020 — forked from kasperpeulen/README.md
How to get a timestamp in Dart.
View README.md
View IsBoolNumber.swift
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
}
View dart_enum_description.dart
enum MyEnum {
simple,
special,
complex,
}
extension MyEnumUtils on MyEnum {
String get description {
switch (this) {
case MyEnum.simple: