Posts

Showing posts with the label How Tos

How to Use SODA for REST with OAuth Client Credentials in your Node.js/Web App to CRUD Oracle Autonomous Database?

Image
Use SODA for REST with OAuth Client Credentials in your Node.js or Web application to CRUD Oracle Autonomous Database

How to Internationalizing your Flutter apps ?

Image
First Reading: https://flutter.dev/docs/development/accessibility-and-localization/internationalization Steps: 1. add flutter_localizations dependencies into pubspec.yaml dependencies : flutter : sdk : flutter flutter_localizations : sdk : flutter 2. add localizationsDelegates and supportedLocales into MaterialApp Applocalizations.delegate is your app-specific localization delegate. will be introduced in next step. Widget build ( BuildContext context) { return MaterialApp ( localizationsDelegates: [ AppLocalizations .delegate, GlobalMaterialLocalizations .delegate, GlobalWidgetsLocalizations .delegate, GlobalCupertinoLocalizations .delegate, ], supportedLocales: [ const Locale . fromSubtags (languageCode: 'zh' ), // generic Chinese 'zh' const Locale . fromSubtags ( languageCode: 'zh' , scriptCode: 'Hans' ), // generic simplified Chinese 'z

How to obtain/get copied image from clipboard data in browser

Image
JS code works well for Chrome, Firefox and Safari const source = document.querySelector('.source'); source.addEventListener('paste', (event) => { if (event.clipboardData && event.clipboardData.items && event.clipboardData.items.length == 1) { const item = event.clipboardData.items[0]; if (item.kind == 'file' && item.type == 'image/png') { let blob = item.getAsFile(); let f = new FileReader(); f.onload = (e) => { console.log(e.target.result); } f.readAsDataURL(blob); } } event.preventDefault(); }); Image source to data base64 url from clipboard data