This file contains 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:intl/intl.dart"; | |
extension FormatDate on DateTime { | |
/// Receive a date ([DateTime]) and an optional format (dafalts to [Constants.dateFormat]) | |
/// and return a formated date | |
String formatDate([String format = 'yyyy-MM-dd']) => | |
DateFormat(format).format(this); | |
} | |
class PostModel { |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
This file contains 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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { |
This file contains 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
/** | |
* @author Wendell Rocha | |
* | |
* This file is required to override the LoginHandler method at server for Google oAuth/Facebook Login API/Apple Login API from enhanced_meteorify package. | |
* https://github.com/wendellrocha/enhanced_meteorify | |
*/ | |
Accounts.registerLoginHandler(function (options) { | |
if (options.googleLoginPlugin || options.facebookLoginPlugin || options.appleLoginPlugin) { | |
var user; |
This file contains 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
package adt.queue; | |
import adt.stack.Stack; | |
import adt.stack.StackImpl; | |
import adt.stack.StackOverflowException; | |
import adt.stack.StackUnderflowException; | |
public class QueueUsingStack<T> implements Queue<T> { | |
private Stack<T> stack1; |
This file contains 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
public void sort(T[] array, int leftIndex, int rightIndex) { | |
if(array == null || rightIndex > array.length) | |
throw new IllegalArgumentException(); | |
int gap = rightIndex - leftIndex; | |
boolean trocou = true; | |
int i; | |
while(gap > 1 || trocou) { | |
if(gap > 1) { | |
gap = (int) (gap / 1.25); |
This file contains 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
/** | |
* Data Structures and Algorithms Laboratory | |
* Período 2017.1 | |
* @author Wendell Rocha | |
*/ | |
class ExtendedCoutingSort { | |
public void sort(Integer[] array, int leftIndex, int rightIndex) { | |
if(array == null || rightIndex > array.length) | |
throw new IllegalArgumentException(); |
This file contains 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
/** | |
* Data Structures and Algorithms Laboratory | |
* Período 2017.1 | |
* @author Wendell Rocha | |
*/ | |
import java.util.*; | |
public class CountingSort { | |
public void sort(Integer[] array, int leftIndex, int rightIndex) { |