ts-node -r dotenv/config xxx.ts dotenv_config_path=../../../.env.staging
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
| Future<Map<String, String>?>? getHeader() async { | |
| final authenticated = auth.user != null; | |
| if (!authenticated) { | |
| return null; | |
| } | |
| var currentToken = await auth.user!.getIdToken(); | |
| var decodedToken = JwtDecoder.decode(currentToken!); | |
| var retryTimes = 0; | |
| while (decodedToken['https://hasura.io/jwt/claims'] == null && | |
| retryTimes < 10) { |
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
| DART_DEFINES=QllQQVNTX0FVVEhFTlRJQ0FUSU9OPWZhbHNl,SEFTVVJBX0FETUlOX1NFQ1JFVD0=,SEFTVVJBX0VORF9QT0lOVD1odHRwczovLzUyLjc0LjEyNS4xNC5uaXAuaW8vYXBpL3Jlc3Q=,RU1BSUxfU1VGRklYPUBraWRkeWltYWdpbmF0aW9uLmhr,aXNNb2JpbGU9dHJ1ZQ==,QVBQVVNFUl9FTUFJTF9TVUZGSVg9QHByb2Qua2lkZHlpbWFnaW5hdGlvbi5oaw== |
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
| function generateSQLFunction(schemaName, tableName, columnName, isNullable) { | |
| const nonNullableScript = `CREATE OR REPLACE FUNCTION ${schemaName}.${tableName}_${columnName}(data_row ${schemaName}.${tableName}, hasura_session json) | |
| RETURNS text | |
| LANGUAGE sql | |
| STABLE | |
| AS | |
| $function$ | |
| SELECT CASE | |
| WHEN (hasura_session ->> 'x-hasura-preferred-lang' = 'en') THEN data_row."${columnName}En" |
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
| class ShopCouponList extends HookConsumerWidget { | |
| final ShopCouponType type; | |
| const ShopCouponList({ | |
| super.key, | |
| required this.type, | |
| }); | |
| @override | |
| Widget build(BuildContext context, WidgetRef ref) { | |
| const loadingWidget = Padding( |
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
| tell application "System Events" | |
| if (get name of every application process) contains "scrcpy" then | |
| -- Support the scrcpy emulator | |
| log "Contains scrcpy" | |
| tell application process "scrcpy" | |
| set frontmost to true | |
| end tell | |
| else | |
| -- Support the system emulator | |
| log "ask emulator to show as frontmost" |
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
| # Just run this in your terminal | |
| adb -e shell su root date $(date +%m%d%H%M%Y.%S) |
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
| # To support the GraphQL validation in VSCode | |
| name: "GraphQL API" | |
| schema: "./schema.graphql" | |
| documents: "./graphql/**/*.graphql" |
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
| ReturnType run<ReturnType>(ReturnType Function() operation) { | |
| return operation(); | |
| } | |
| extension ScopeFunctionsForObject<T extends Object> on T { | |
| ReturnType let<ReturnType>(ReturnType Function(T item) operationFor) { | |
| return operationFor(this); | |
| } | |
| T also(void Function(T item) operationFor) { |
NewerOlder