Repositório contendo os materiais que eu utilizei na palestra.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum MyEnum { | |
simple, | |
special, | |
complex, | |
} | |
extension MyEnumUtils on MyEnum { | |
String get description { | |
switch (this) { | |
case MyEnum.simple: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
#dart:core example
How to get a timestamp in Dart.
Main library: dart:core
Main element: DateTime.now
Gist: https://gist.github.com/kasperpeulen/c54b5925019b62843ef9
DartPad: https://dartpad.dartlang.org/c54b5925019b62843ef9
Tags: #datetime #timestamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class Carousel<T> extends StatelessWidget { | |
final double height; | |
final List<T> items; | |
final Widget child; | |
final double itemExtent; | |
final double spaceBetweenItems; | |
final double spacingFirstItem; | |
final double spacingLastItem; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'dart:math' as math; | |
class Carousel<T> extends StatefulWidget { | |
final Widget child; | |
final List<T> items; | |
final double itemExtent; | |
final double itemWidth; | |
final double itemHorizontalMargin; | |
final double listHeight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final String _text = 'ExTEnSiON'; | |
String _capitalize(String text){ | |
return "${text[0].toUpperCase()}${text.toLowerCase().substring(1)}"; | |
} | |
print(_capitalize(_text)); //Extension | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
final String _text = 'ExTEnSiON'; | |
print(_text.capitalize()); //Extension | |
} | |
extension StringExtensions on String { | |
String capitalize() { | |
return "${this[0].toUpperCase()}${this.toLowerCase().substring(1)}"; | |
} |