Skip to content

Instantly share code, notes, and snippets.

View mattrussell-sonocent's full-sized avatar

Matt Russell mattrussell-sonocent

  • Glean
  • United Kingdom
View GitHub Profile
@mattrussell-sonocent
mattrussell-sonocent / TransactionManager.dart
Last active June 7, 2022 12:50
Zone values for transaction propagation
import 'dart:async';
import 'dart:math';
import 'package:sembast/sembast.dart';
import 'package:sembast/sembast_io.dart';
Future<void> main() async {
final dbPath = 'sample-${Random().nextInt(10000)}.db';
final dbFactory = databaseFactoryIo;
final db = await dbFactory.openDatabase(dbPath);
@mattrussell-sonocent
mattrussell-sonocent / parser.ts
Created March 19, 2019 09:14
parsimmon example
import { alt, any, eof, notFollowedBy, oneOf, optWhitespace, Parser, regexp, seqMap, string } from 'parsimmon'
enum CommandType {
IMPORTANT = 'IMPORTANT',
REVIEW = 'REVIEW',
TASK = 'TASK',
HEADING = 'HEADING'
}
interface CommandParseResult {
package com.example
import com.fasterxml.jackson.databind.SerializationFeature
import io.ktor.application.Application
import io.ktor.application.call
import io.ktor.application.install
import io.ktor.features.ContentNegotiation
import io.ktor.http.ContentType
import io.ktor.jackson.jackson
import io.ktor.request.receive
nettyCallPool-4-1" #15 prio=10 os_prio=0 tid=0x00005641d0e92800 nid=0x1b waiting on condition [0x00007f81102df000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:338)
at kotlinx.coroutines.io.jvm.javaio.BlockingAdapter.parkingLoop(Blocking.kt:235)
at kotlinx.coroutines.io.jvm.javaio.BlockingAdapter.submitAndAwait(Blocking.kt:215)
at kotlinx.coroutines.io.jvm.javaio.BlockingAdapter.submitAndAwait(Blocking.kt:186)
at kotlinx.coroutines.io.jvm.javaio.InputAdapter.read(Blocking.kt:55)
- locked <0x00000000faf35ec0> (a kotlinx.coroutines.io.jvm.javaio.InputAdapter)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)