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 'package:flutter/services.dart' show Clipboard, ClipboardData; | |
import 'package:google_sign_in/google_sign_in.dart'; | |
import 'package:graphql_flutter/graphql_flutter.dart' show AuthLink; | |
/// Our `google_sign_in` client | |
GoogleSignIn _googleSignIn = GoogleSignIn( | |
scopes: <String>['email', 'profile'], | |
); |
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
#!/bin/sh | |
# Plugins handle upsert${table} and upsert${table}Batch functions | |
# Add a `create${table}Batch` function to the schema | |
# for the given $table, allowing for bulk creates | |
function batch_create { | |
table=$1 | |
inputName=$2 | |
echo " |
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
function removeUpTo( | |
s: string | undefined, | |
prefix: RegExp | |
){ | |
if (s === undefined){ | |
return undefined | |
} | |
s = s.trim() | |
const i = s.search(prefix) | |
if (i == -1){ |
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
class StupidNumber: | |
"""A stupid viral facebook arithmetic puzzle with overridden operators | |
""" | |
_number: int | |
def __init__(self, number: int): | |
self._number = number | |
def __add__(self, other): | |
return StupidNumber(self._number * (other._number + 1)) |
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
void printKwargs({ | |
String string = 'default', | |
bool boolean = false, | |
int integer = 1, | |
}) { | |
print([string, boolean, integer]); | |
} | |
Map<Symbol, dynamic> symbolizeKeys(Map<String, dynamic> map) => | |
map.map((key, value) => MapEntry(Symbol(key), value)); |
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
/* | |
FULL cheaters_global_key.dart example, | |
contents: | |
* first defines the cheaters_global_key, | |
* then a few helpers | |
* then at the bottom a usage example | |
BEGIN cheaters_global_keys.dart | |
*/ |
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'; | |
void main() => runApp(FormPopExample()); | |
class FormPopExample extends StatefulWidget { | |
@override | |
_FormPopExampleState createState() => _FormPopExampleState(); | |
} | |
class _FormPopExampleState extends State<FormPopExample> { |
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/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
@immutable | |
class AnimationOptions { | |
AnimationOptions({ | |
this.curve = Curves.linear, | |
@required this.duration, | |
this.onEnd, | |
}); |
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
class ThisClass { | |
int bar; | |
ThisClass(this.bar); | |
@override | |
bool operator ==(other) => other is ThisClass && other.bar == bar; | |
} | |
class ThatClass extends ThisClass { | |
ThatClass(int bar, this.bob) : super(bar); | |
int bob; |
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
/// Extensible enum that has `instance.asKnown` for good switch tooling | |
enum KnownReleaseType { | |
ALPHA, | |
BETA, | |
GAMMA, | |
} | |
class ReleaseType { | |
ReleaseType(String value) : value = _parseValue(value); |