Skip to content

Instantly share code, notes, and snippets.

View martinbonnin's full-sized avatar
😃

Martin Bonnin martinbonnin

😃
View GitHub Profile
#!/usr/bin/env kotlin
@file:DependsOn("com.apollographql.apollo3:apollo-ast:4.0.0-alpha.2")
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.5.1")
@file:OptIn(ApolloExperimental::class)
import com.apollographql.apollo3.annotations.*
import com.apollographql.apollo3.ast.*
import com.apollographql.apollo3.ast.introspection.*
#!/usr/bin/env kotlin
@file:DependsOn("com.apollographql.apollo3:apollo-ast:3.8.2")
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.5.1")
@file:OptIn(ApolloExperimental::class)
import com.apollographql.apollo3.annotations.*
import com.apollographql.apollo3.ast.*
import com.apollographql.apollo3.ast.introspection.*
#!/usr/bin/env kotlin
@file:Repository("file:///Users/mbonnin/git/apollo-kotlin/build/localMaven")
@file:Repository("https://repo.maven.apache.org/maven2/")
@file:DependsOn("com.apollographql.apollo3:apollo-gradle-plugin:4.0.0-alpha.3-SNAPSHOT")
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2")
import com.apollographql.apollo3.gradle.api.ApolloExtension
import kotlinx.metadata.jvm.KotlinClassMetadata
@Test
fun validate() {
val schemaString = """
type Query {
user: User!
}
type User {
firstName: String!
lastName: String!
#!/usr/bin/env kotlin
/**
* A Kotlin script that will collect all test reports and core dumps from your CI runs
* zip them and upload them as a Github Actions artifact
*
* Copy this file to scripts/collect-diagnostics.main.kts and add the below to your
* Github Actions workflow file:
*
* - name: Collect Diagnostics
/**
* Creates a new explicit staging repo on OSSRH before uploading artifacts to avoid split repos when using implicit repos.
*
* This can be done more elegantly using okhttp or any other HTTP/Json lib. This snippet uses
* the good old URLConnection to avoid any dependency.
*
* To open a staging repo with curl, do curl -d "{\"data\": {\"description\": \"description\"}}"
* -v -u $SONATYPE_NEXUS_USERNAME:$SONATYPE_NEXUS_PASSWORD https://oss.sonatype.org/service/local/staging/profiles/$VESPENE_STAGING_PROFILE_ID/start -H "Content-Type: application/json"
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <sys/time.h>
#include "sqlite3.h"
/**
* A bunch of tests to try to understand why selecting 999 keys in a single statement is faster than selecting 1 key 999 times
*
import org.junit.Test
import java.sql.Connection
import java.sql.DriverManager
import java.sql.PreparedStatement
import java.sql.ResultSet
import kotlin.time.ExperimentalTime
import kotlin.time.measureTime
/**
* A bunch of tests to try to understand why selecting 999 keys in a single statement is faster than selecting 1 key 999 times
{
"data": {
"viewer": {
"__typename": "User",
"login": "toto",
"repositories": {
"__typename": "RepositoryConnection",
"nodes": [
{
"__typename": "Repository",