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:flutter/material.dart'; | |
import 'gd_button.dart'; | |
import 'gd_flex_row.dart'; | |
import 'gt_text_field.dart'; | |
import 'gd_green_bar.dart'; | |
typedef FilterFunction<T> = bool Function(String, T); | |
typedef SortFunction<T> = int Function(T, T); | |
typedef HeaderBuilder<T> = Widget Function(BuildContext, FilterFunction<T>, SortFunction<T>); | |
typedef Listener<T> = void Function(List<T>); |
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:flutter/material.dart'; | |
class FancyFutureBuilder<T> extends StatelessWidget { | |
final Future<T> future; | |
final Widget Function (BuildContext , AsyncSnapshot<T>) builder; | |
final Function doNavigation; | |
final bool Function(Object) shouldNavigate; | |
FancyFutureBuilder({ |
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
flutter doctor | |
Doctor summary (to see all details, run flutter doctor -v): | |
[√] Flutter (Channel master, v1.15.3-pre.37, on Microsoft Windows [Version 10.0.18362.592], locale en-AU) | |
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2) | |
X Android license status unknown. | |
Try re-installing or updating your Android SDK Manager. | |
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions. | |
[√] Chrome - develop for the web | |
[√] Android Studio (version 3.5) | |
[!] IntelliJ IDEA Community Edition (version 2019.3) |
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 'dart:html'; | |
import 'package:flutter/material.dart'; | |
import 'package:growdata_shared_web/component/gd_red_text.dart'; | |
class GdFileInput extends StatefulWidget { | |
final void Function(String, List<int>) fileSelected; | |
final List<String> extensions; | |
GdFileInput(this.fileSelected, {this.extensions}); |
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:http/http.dart' as http; | |
import 'package:http_parser/http_parser.dart'; | |
Future<http.Response> uploadFile( | |
String url, | |
Map<String, String> headers, | |
Map<String, String> fields, | |
String fileName, | |
List<int> fileBytes) async { | |
var request = new http.MultipartRequest("POST", Uri.parse(url)); |
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
for each tick | |
for each company | |
execute destruction orders | |
productionBuildings | |
add resourceSource inputs | |
add stockPile inputs | |
add autoBuy inputs | |
consume power |
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
trait Dao[T] { | |
val tableName: String | |
def find(id:String): ConnectionIO[Option[T]] = | |
Fragment.const("select * from $tableName where id = ") ++ fr"$id".query[T] | |
} | |
case class Foo(id: String, data: String) | |
object Foos extends Dao[Foo] { |
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 requests | |
from bs4 import BeautifulSoup | |
def coles_price(): | |
r = requests.get('http://shop.coles.com.au/online/mobile/national/limes-loose') | |
if r.status_code == 200: | |
soup = BeautifulSoup(r.text, 'html.parser') | |
price_text = soup.find('p', {'class': 'price'}).get_text() | |
return float(price_text.replace('$', '')) | |
else: |
NewerOlder