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
/** | |
* CloudFront function for responding to CORS Preflight requests at the edge. | |
* | |
* See: https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request | |
*/ | |
async function handler(event) { | |
const request = event.request; | |
if (request.method === 'OPTIONS' && request.headers.origin) { | |
// see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/functions-event-structure.html#functions-event-structure-response | |
const response = { |
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 STRICH SDK as an ES6 module directly from a CDN | |
import {StrichSDK, BarcodeReader} from 'https://cdn.jsdelivr.net/npm/@pixelverse/[email protected]/dist/strich.js'; | |
// AAMVA helper routines | |
import {parseAAMVALicenseData} from "./aamva.js"; | |
function processPDF417Barcode(codeDetection) { | |
// attempt to parse barcode data as AAMVA driver's license | |
const parsed = parseAAMVALicenseData(codeDetection.data); |
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
body, html { | |
width: 100%; | |
font-family: sans-serif; | |
margin: 0; | |
} | |
.container { | |
height: 100vh; | |
position: relative; | |
background-color: black; |
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
<html lang="en"> | |
<head> | |
<title>PDF417 Age Check</title> | |
<link rel="stylesheet" type="text/css" href="styles.css"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
</head> | |
<body> | |
<div class="container"> | |
<!-- this is where the barcode scanner will live --> |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Schedule2</title> | |
<base href="/"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> |

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
private val uiState = mutableStateOf(UiState(/* initial state */)) | |
// ... | |
override fun connectionLost(cause: Throwable?) { | |
uiState.value = uiState.value.copy( | |
statusMessage = "Connection lost", | |
connected = false | |
) | |
} |
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
/** | |
* Encapsulation of UI state | |
*/ | |
data class UiState( | |
val connected: Boolean, | |
val statusMessage: String, | |
val window1Open: Boolean?, | |
val window2Open: Boolean?, | |
val window3Open: Boolean?, | |
val window4Open: Boolean?, |
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
{ | |
"version": 1, | |
"metadata": { | |
"lastUpdated": "2021-09-13T08:41:16+0000", | |
"message": "Projektdaten Bahnhof Lausanne. Bei Fragen Mathias Kuhn kontaktieren." | |
}, | |
"data": { | |
"documents": [ | |
{ | |
"number": "GC.GA.00.COF.DT.0001", |
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
package com.classycode.touchidexample; | |
import com.sun.jna.Callback; | |
import com.sun.jna.Library; | |
interface JTouchID extends Library { | |
interface AuthCallback extends Callback { | |
void callback(int result, int laError); |
NewerOlder