Skip to content

Instantly share code, notes, and snippets.

Avatar
😃

Martin Bonnin martinbonnin

😃
View GitHub Profile
View fragment-linter.kt
@Test
fun validate() {
val schemaString = """
type Query {
user: User!
}
type User {
firstName: String!
lastName: String!
View collect-diagnostics.main.kts
#!/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
View build.gradle.kts
/**
* 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"
*/
View SQLiteTest.c
#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
*
View SQLiteTest.kt
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
View githubRepos.json
{
"data": {
"viewer": {
"__typename": "User",
"login": "toto",
"repositories": {
"__typename": "RepositoryConnection",
"nodes": [
{
"__typename": "Repository",
View introspection.graphql
query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
name
View clickt.module.json
{
"formatVersion": "1.1",
"component": { [SKIPPED] },
"createdBy": { [SKIPPED] },
"variants": [
{
"name": "js-api",
"attributes": {
"org.gradle.usage": "kotlin-api",
"org.jetbrains.kotlin.platform.type": "js"