Skip to content

Instantly share code, notes, and snippets.

View bjonnh's full-sized avatar
🐈

Jonathan Bisson bjonnh

🐈
View GitHub Profile
import arrow.effects.IO
class File(url: String) {
fun open(): File = this
fun close(): Unit {}
override fun toString(): String = "This file contains some interesting content!"
}
fun openFile(uri: String): IO<File> = IO { throw RuntimeException() }
package arrowdebug
import arrow.effects.extensions.io.fx.fx
import arrow.effects.IO
sealed class Error : RuntimeException()
object ClientInvalidQuery : Error()
object ClientQueryTimeout : Error()
object NotInTransaction : Error()
java.lang.NullPointerException
at com.sun.javafx.text.PrismTextLayout.addTextRun(PrismTextLayout.java:755)
at com.sun.javafx.text.GlyphLayout.addTextRun(GlyphLayout.java:140)
at com.sun.javafx.text.GlyphLayout.breakRuns(GlyphLayout.java:312)
at com.sun.javafx.text.PrismTextLayout.buildRuns(PrismTextLayout.java:770)
at com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1021)
at com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:223)
at com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:246)
at javafx.scene.text.Text.getLogicalBounds(Text.java:358)
at javafx.scene.text.Text.impl_computeLayoutBounds(Text.java:1115)
class QueryFragment : Fragment() {
val name = SimpleStringProperty("Default")
val error = SimpleStringProperty("Wow")
var query: TextArea by singleAssign()
var errorPane: NotificationPane by singleAssign()
var button: Button by singleAssign()
override val root = vbox {
form {
fieldset {
field("Name") {
class ResultFragment: Fragment() {
var insertInQuery: MenuItem by singleAssign()
override val scope = super.scope as ResultsScope
override val root = tableview(scope.items) {
columnResizePolicy = TableView.CONSTRAINED_RESIZE_POLICY
smartResize()
selectionModel.isCellSelectionEnabled = true
contextMenu = ContextMenu().apply {
insertInQuery = item("Insert in queryTextArea")
class Query(subject: Resource?, label: String, content: String) {
private val originalSubjectProperty = SimpleStringProperty(subject.toString())
fun originalSubjectProperty() = originalSubjectProperty
var originalSubject by originalSubjectProperty
private val subjectProperty = SimpleStringProperty(subject.toString())
fun subjectProperty() = subjectProperty
var subject by subjectProperty
private val originalLabelProperty = SimpleStringProperty(label)
import unittest
import rnaviewparser.rnaview_ast as ast
class TestNode(unittest.TestCase):
def test_repr(self):
node = ast.Node([])
self.assertEqual(node.__repr__(), "Basic Node")
if __name__ == '__main__':
unittest.main()
from enum import Enum
from dataclasses import dataclass, field
from typing import List
class TYPES(Enum):
STD = "std"
WW = "W/W"
HH = "H/H"
SS = "S/S"
WH = "W/H"
override fun call(url: String, parameters: Map<String, String>): IO<String> =
fx {
effect { calcDelay() }
val call: HttpClientCall = effect {
httpClient.call("$apiURL/$url") {
method = HttpMethod.Get
parameters.forEach { k, v -> parameter(k, v) }
}
}
effect {
package net.nprod.failuretable
import javafx.beans.property.SimpleListProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.scene.control.TableView
import javafx.scene.paint.Color
import javafx.stage.Stage
import tornadofx.*
import java.time.LocalDate
import java.time.Period