I hereby claim:
- I am kilink on github.
- I am kilink (https://keybase.io/kilink) on keybase.
- I have a public key whose fingerprint is F23F CF51 9040 9BC9 1DEA 0C26 8A40 3841 C80A 0CB5
To claim this, I am signing this object:
| import graphql.parser.InvalidSyntaxException | |
| import graphql.parser.Parser | |
| import graphql.schema.GraphQLSchema | |
| import graphql.schema.idl.RuntimeWiring | |
| import graphql.schema.idl.SchemaGenerator | |
| import graphql.schema.idl.SchemaParser | |
| import graphql.validation.ValidationError | |
| import graphql.validation.Validator | |
| import org.junit.jupiter.api.Test | |
| import org.junit.jupiter.api.fail |
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| objects: [{name: "foo"}, {name: "bar"}], | |
| actions: { | |
| add() { | |
| this.get('objects').pushObject({name: "baz"}); | |
| }, | |
| remove() { |
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| objects: [{name: "foo"}, {name: "bar"}], | |
| actions: { | |
| add() { | |
| this.get('objects').pushObject({name: "baz"}); | |
| }, | |
| remove() { |
| fun main(args: Array<String>) { | |
| val mapper = ObjectMapper().registerKotlinModule() | |
| val obj = Foo("foo", "bar", 3) | |
| val obj2 = merge<Foo>(obj, mapper.readValue<ObjectNode>("""{"x": "baz", "z": 5}""")) | |
| println("obj=${obj} obj2=${obj2}, obj === obj2 is ${obj === obj2}") | |
| } | |
| fun <T> merge(obj: Any, json: ObjectNode): T { |
| @JsonDeserialize(using = KotlinDataDeserializer::class) | |
| data class Foo(val x: String, val y: String, val z: Int) | |
| class KotlinDataDeserializer : StdDeserializer<Foo>(Foo::class.java) { | |
| override fun deserialize(p: JsonParser, ctxt: DeserializationContext): Foo { | |
| return p.readValueAs(Foo::class.java) | |
| } | |
| override fun deserialize(p: JsonParser, ctxt: DeserializationContext, intoValue: Foo): Foo { | |
| val copy = intoValue::copy |
| import java.io.IOException | |
| import okhttp3.Call | |
| import okhttp3.Callback | |
| import okhttp3.Response | |
| import rx.Single | |
| fun Call.toSingle(): Single<Response> = | |
| Single.create { subscriber -> | |
| enqueue(object : Callback { | |
| override fun onResponse(call: Call, response: Response) { |
| import okhttp3.Call | |
| import okhttp3.Callback | |
| import okhttp3.Response | |
| import java.io.IOException | |
| import java.util.concurrent.CompletableFuture | |
| fun Call.executeAsync(): CompletableFuture<Response> { | |
| val future = CompletableFuture<Response>() | |
| enqueue(object : Callback { | |
| override fun onResponse(call: Call, response: Response) { |
| import inspect | |
| import re | |
| import sys | |
| class T(object): | |
| pattern = re.compile("#{(.+)}") | |
| currentframe = inspect.currentframe | |
| def __call__(self, template): |
I hereby claim:
To claim this, I am signing this object:
| import collections | |
| dictionary = """ab | |
| ac | |
| b | |
| xe | |
| e | |
| df | |
| dx | |
| de |