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
| import os | |
| import shutil | |
| def extract_jpg_files(root_folder): | |
| for root, dirs, files in os.walk(root_folder): | |
| for file in files: | |
| if file.endswith('.jpg'): | |
| source_path = os.path.join(root, file) | |
| destination_path = os.path.join(root_folder, file) | |
| shutil.move(source_path, destination_path) |
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
| # This is a function for capturing screenshots with GDScript | |
| func screenshot(): | |
| # Capture the screenshot | |
| var size = OS.window_size | |
| var image = get_viewport().get_texture().get_data() | |
| # Setup path and screenshot filename | |
| var date = OS.get_datetime() | |
| var path = "user://screenshots" | |
| var file_name = "screenshot-%d-%02d-%02dT%02d:%02d:%02d" % [date.year, date.month, date.day, date.hour, date.minute, date.second] |
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
| public class ScreenShooter : MonoBehaviour { | |
| private int _count = 0; | |
| // Update is called once per frame | |
| private void Update() { | |
| if ( Input.GetKeyDown( KeyCode.S ) ) { | |
| while ( System.IO.File.Exists( "ScreenShot_" + _count + "_" + Screen.width + "x" + Screen.height + ".png" ) ) { | |
| _count++; | |
| } | |
| ScreenCapture.CaptureScreenshot( "ScreenShot_" + _count + "_" + Screen.width + "x" + Screen.height + ".png" ); | |
| } |
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
| void main() { | |
| final configuredApp = AppConfig( | |
| appName: 'App', | |
| flavorName: 'uat', | |
| apiBaseUrl: uatServerUrl, | |
| coreAppBaseUrl: uatServerCoreUrl, | |
| child: App( | |
| WebService.create(uatServerUrl), | |
| StorageServiceImpl(), | |
| CoreAppWebService.create(uatServerCoreUrl), |
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 AppConfig extends InheritedWidget { | |
| const AppConfig({ | |
| Key? key, | |
| required this.appName, | |
| required this.flavorName, | |
| required this.apiBaseUrl, | |
| required this.coreAppBaseUrl, | |
| required Widget child, | |
| }) : super(child: child); |
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 StringHelper { | |
| static String removeAllHtmlTags(String htmlText) { | |
| final RegExp exp = RegExp("<[^>]*>", multiLine: true); | |
| return htmlText.replaceAll(exp, ''); | |
| } | |
| static String shrinkSecondName(String? name) { | |
| if (name != null && name.isNotEmpty) { | |
| final nameStr = name.split(' '); |
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
| extension UserExtension on User { | |
| DBUser getDbVersion() => | |
| DBUser(id, avatar ?? "", email ?? "", language ?? "", name ?? ""); | |
| } |
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
| import json | |
| import stringcase | |
| from xml.dom import minidom | |
| xmldoc = minidom.parse('strings.xml') | |
| itemlist = xmldoc.getElementsByTagName('string') | |
| with open('strings.json', 'w', encoding='utf8') as out_file: | |
| out_file.write('{') | |
| for s in itemlist: |
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
| part 'user_store.g.dart'; | |
| /// User Store | |
| class UserStore = UserStoreBase with _$UserStore; | |
| /// User Store | |
| abstract class UserStoreBase with Store { | |
| final WebService _webService; | |
| final StorageService _storageService; |