pip install -r requirements.txt
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 json | |
import sys | |
import os | |
from pathlib import Path | |
from typing import Dict, List, Tuple | |
""" | |
Validate multiple json files at once. | |
In Terminal call: | |
python json_validator.py /path/to/directory/with/jsons |
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
/// Helper function to extract the current method name from the stack trace | |
String getCurrentMethodName() { | |
final frames = StackTrace.current.toString().split('\n'); | |
// The second frame in the stack trace contains the current method | |
final frame = frames.elementAtOrNull(1); | |
if (frame != null) { | |
// Extract the method name from the frame. For example, given this input string: | |
// #1 LoggerAnalyticsClient.trackAppOpen (package:flutter_ship_app/src/monitoring/logger_analytics_client.dart:28:9) | |
// The code will return: LoggerAnalyticsClient.trackAppOpen | |
final tokens = frame |
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
<artifacts_info> | |
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity. | |
# Good artifacts are... | |
- Substantial content (>15 lines) | |
- Content that the user is likely to modify, iterate on, or take ownership of | |
- Self-contained, complex content that can be understood on its own, without context from the conversation | |
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations) | |
- Content likely to be referenced or reused multiple times |
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
<!-- Add this file to: ~/Library/Developer/Xcode/UserData/FontAndColorThemes --> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DVTConsoleDebuggerInputTextColor</key> | |
<string>0.901961 0.831373 0.639216 1</string> | |
<key>DVTConsoleDebuggerInputTextFont</key> | |
<string>SFMono-Bold - 11.0</string> | |
<key>DVTConsoleDebuggerOutputTextColor</key> |
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
/// This gist assumes that Flutter Blue (https://github.com/pauldemarco/flutter_blue) is used to connect to a BBC Micro:bit | |
/// and is listening to the [device.onValueChanged] for the correct characteristic ("E95DCA4B-251D-470A-A062FA1922DFA9A8") | |
/// | |
/// this will be something similar to | |
/// | |
/// device.onValueChanged( (accChar).listen( (value){ convertRawData(value)})); | |
/// | |
/// the 'raw' listen value is a List<int> of length 6 this needs to be converted into the X,Y and Z values from the | |
/// accelerometer and is done with the function below | |
/// |
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 Adder implements Function { | |
call(int a, int b) => a + b; | |
} | |
class Incrementer implements Function { | |
int _amt; | |
Incrementer(this._amt); | |
call(int a) => a + _amt; | |
} |
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 2021, Thea Choem, All rights reserved. | |
import 'package:badges/badges.dart'; | |
import 'package:flutter/material.dart'; | |
class CustomTabBarItem { | |
final String label; | |
final String? value; | |
CustomTabBarItem({ |
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
/// Based on the answer of Przemek Broda: | |
/// https://stackoverflow.com/questions/51825779/blur-background-behind-dialog-flutter/62361699#62361699 | |
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
void showProgressView(BuildContext context, {bool dismissible = false}) { | |
showGeneralDialog( | |
context: context, | |
barrierColor: Theme.of(context).colorScheme.surface.withOpacity(0.5), |
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 Example extends StatelessWidget { | |
const Example({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
final colorScheme = Theme.of(context).colorScheme; |
NewerOlder