Skip to content

Instantly share code, notes, and snippets.

View nemethmik's full-sized avatar

Miklos Nemeth nemethmik

  • nemethmiklos1960
  • Budapest
View GitHub Profile
@nemethmik
nemethmik / easywebcomps-index-litshadowslots.html
Created October 13, 2021 11:12
A single-page show case using Lit-html and LitElement directly in an HTML page featuring Shadow DOM custom elements with Bootstrap support, Custom Event handling and a lot more.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id=bootstrap href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<title>Lit Shadow Web Components</title>
</head>
<body>
<style>
@nemethmik
nemethmik / tizenwebapiflowtypes.js
Last active April 9, 2020 22:45
A Flow comment-style type definitions of the Application and Package modules of the Tizen Web API
//@flow
/*::
// Version 20200409
//https://docs.tizen.org/application/web/api/latest/device_api/wearable/tizen/tizen.html#full-webidl
declare var tizen: Tizen; //The tizen runtime will provide this global variable in the window object.
declare interface Tizen extends ApplicationManagerObject, PackageManagerObject{ }
declare type long = number;
declare type short = number;
declare type DOMString = string;
//type ByteStream=octet[];
@nemethmik
nemethmik / sapb1poemsimpledatainterface.puml
Created March 31, 2020 13:44
SAP B1 POEM Simple Data Interface Architecture Diagram (Plant UML)
@startuml SAP Business One - POEM Simple Data Intarface Architecture
cloud {
node "windows server" {
[B1 Data Interface Server] - b1dis_GET
[B1 Data Interface Server] -u- b1dis_POST
[B1 Data Interface Server] -d-> [B1 Data Updater Process]
database "SAP B1 Company" as sapdb {
storage ToDosTable
storage UserQueries
storage "owor, wor1, rdr1" as so
@nemethmik
nemethmik / howtousehttpclient_test.dart
Created August 4, 2019 18:54
How to use Dart's low level HttpClient with timeout and getting back the response text from the HttpClientResponse stream
import 'package:test/test.dart';
import 'dart:async';
import 'dart:io';
import 'dart:convert';
void main() {
group("B1SL_LoginTestSeries", () {
const ipAddress = "http://hana93srv:50001";
const url = "/b1s/v1/";
const user = "manager";
@nemethmik
nemethmik / nosuchmethodonsetoption_test.dart
Created August 4, 2019 18:30
When timeout is raised on HttpClient because of IP address issues, NoSuchMethodEror is thrown instead of SocketException
import 'dart:io';
import 'package:test/test.dart';
void main() {
test("Login with HTTPClient",() async {
try {
//final String queryUrl = "http://google.com"; //OK
// final String queryUrl = "http://googleKRIXKRAKSZ.com"; //SocketException is OK
//
// NoSuchMethodError: The method 'setOption' was called on null.
// Receiver: null
@nemethmik
nemethmik / main.dart
Last active August 4, 2019 21:23
The Precedence of Functions Defined by Multiple Dart Mixins
//import "dart:collection";
//class MyList with ListMixin {}
class Food {
void cook(){}
}
class Recipe implements Food {
//List<String> ingredients;
//Recipe(this.ingredients){}
void cook(){print("Cook in Recipe");}
@nemethmik
nemethmik / main.dart
Created January 19, 2019 07:19
A self-contained runnable Flutter example of using StatefulBuilder to make a wrapper context for Form.of (line 21) to return the parent form (line 11)
import "package:flutter/material.dart";
//https://github.com/flutter/flutter/issues/26772#issuecomment-455674193
main() {runApp(MaterialApp(home:HomeScreen()));}
class HomeScreen extends StatefulWidget {@override createState() {return _HomeScreen();}}
class _HomeScreen extends State<StatefulWidget> {
String data;
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
@override Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Home")),
@nemethmik
nemethmik / main.dart
Created January 18, 2019 20:12
Form.of Returning NULL Error Demonstration
import "package:flutter/material.dart";
main() {runApp(MaterialApp(home:HomeScreen()));}
class HomeScreen extends StatefulWidget {@override createState() {return _HomeScreen();}}
class _HomeScreen extends State<StatefulWidget> {
String data;
final GlobalKey<FormState> formKey = GlobalKey<FormState>();
@override Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Home")),
body:Form(key:this.formKey,