This file contains 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
@file:Suppress("NonAsciiCharacters") | |
sealed class Either<out A, out B> | |
data class Left<out A> constructor(val value: A) : Either<A, Nothing>() | |
data class Right<out B> constructor(val value: B) : Either<Nothing, B>() | |
typealias `∧`<φ, ψ> = Pair<φ, ψ> | |
typealias `∨`<φ, ψ> = Either<φ, ψ> |
This file contains 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
const loadSpec = async () => ({ | |
given: () => "I have 100 shares of MSFT stock", | |
when: () => "When I ask to sell 20 shares of MSFT stock", | |
then: () => "Then I should have 80 shares of MSFT stock" | |
}) | |
const printSpec = async () => { | |
const { given, when, then } = await loadSpec() | |
console.log(given()) | |
console.log(when()) |
This file contains 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
// Implementation of DAGs based on: | |
// Jeremy Gibbons, An Initial-Algebra Approach to Directed Acyclic Graphs, 1995 | |
// https://www.researchgate.net/publication/2423982_An_Initial-Algebra_Approach_to_Directed_Acyclic_Graphs | |
// | |
// Good: | |
// ✅ Immutable, compositional representation that supports structural sharing | |
// ✅ Correct by construction: no way to create cyclic graphs, so no need to check | |
// ✅ Some graph operations are easy: topological sort, certain replacement graph transformations | |
// ✅ Cool underlying theory: graphs are arrows in a symmetric monoidal category | |
// ⚠️ Extensions to the default idea of a DAG: supports multiple edges between the same vertices, ordered ports, and |
This file contains 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
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ | |
The following assertion was thrown running a test: | |
'dart:ui/hash_codes.dart': Failed assertion: line 15: '<optimized out>': is not true. | |
Either the assertion indicates an error in the framework itself, or we should provide substantially | |
more information in this error message to help you determine and fix the underlying cause. | |
In either case, please report this assertion by filing a bug on GitHub: | |
https://github.com/flutter/flutter/issues/new?template=BUG.md | |
When the exception was thrown, this was the stack: |
This file contains 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
class AsyncSerializer { | |
constructor() { | |
this._previousPromise = Promise.resolve(null) | |
} | |
serialize = f => { | |
const newPromise = this._previousPromise.then(() => f()) | |
this._previousPromise = newPromise | |
return newPromise | |
} |
This file contains 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 React from 'react' | |
import { shallow } from 'enzyme' | |
const flushPromises = () => new Promise(resolve => setImmediate(resolve)) | |
const fetchTheData = jest.fn() | |
class MyContainerComponent extends React.Component { | |
state = { error: null } |
This file contains 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 gems.user.service | |
import com.google.inject.ImplementedBy | |
import com.google.inject.Inject | |
import gems.user.dao.UserDao | |
import gems.user.dao.entity.User | |
import gems.user.service.dto.Credentials | |
import gems.user.service.session.Session | |
import gems.user.service.session.SessionManager |
This file contains 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
backend | 15:51:16.951 [main] DEBUG Application - Class Loader: sun.misc.Launcher$AppClassLoader@75b84c92: [/home/gradle/app/backend/build/classes/java/main, /home/gradle/app/backend/build/classes/kotlin/main/, /home/gradle/app/backend/build/resources/main/, /home/gradle/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-server-netty/0.9.2/3ec623b4e61942af1968f44adf00ed14411705f3/ktor-server-netty-0.9.2.jar, /home/gradle/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-auth-jwt/0.9.2/e156bae7c5e75a2492822c7ebfb4611a51c09b55/ktor-auth-jwt-0.9.2.jar, /home/gradle/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-auth/0.9.2/cc9bcc5bd3fd1604071c6f25aa42fc3dfa9c615c/ktor-auth-0.9.2.jar, /home/gradle/.gradle/caches/modules-2/files-2.1/io.ktor/ktor-jackson/0.9.2/424f4a16296755e21219d65190e03eac53b0843b/ktor-jackson-0.9.2.jar, /home/gradle/.gradle/caches/modules-2/files-2.1/org.mpierce.ktor.csrf/ktor-csrf/0.3.0/defdb620ad156ac64c265f0dcf3bdd1fb78f2bb9/ktor-csrf-0.3.0.jar, /home/gradle/.gradle/caches/modules-2/files-2.1 |
This file contains 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
strictfp \u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0063\u006c\u0061\u0073\u0073\u0020\u0052\u0065\u0066\u0075\u0063\u0074\u0020\u007b | |
\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu0020 | |
interface λ<A, B> { | |
public B call(A x); | |
} | |
interface RecursiveFunc<F> extends λ<RecursiveFunc<F>, F> { | |
} | |
private static boolean isDivisibleBy(int n, final int m) { |
This file contains 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
val graph = DAG.empty[String] | |
val graph2 = graph.addVertex("Foo") | |
val graph3 = graph2.addEdge("Foo", "Bar") | |
val graph4 = graph3.addEdge("Baz", "Quux") | |
val graph5 = graph4.removeEdge("Baz", "Quux") | |
val graph6 = graph5.addEdge("Foo", "Baz") | |
val graph7 = graph6.addEdge("Bar" -> "Quux").addEdge("Baz" -> "Quux") | |
graph: DAG[String] = | |
NewerOlder