Skip to content

Instantly share code, notes, and snippets.

import {Mutation, Query} from "./graphql/queries"
import {graphql, OptionProps} from "react-apollo"
import {FetchPolicy} from "apollo-client"
import {ComponentClass, StatelessComponent} from "react"
type Component<P> = ComponentClass<P> | StatelessComponent<P>
interface RenderProps<Props, QueryResult, QueryArgs> {
props: Props
data: QueryResult | null
package net.gtod.cusoon.servicetest
import com.fasterxml.jackson.core.JsonFactory
import net.gtod.cusoon.graphql.parser.parseObject
import net.gtod.cusoon.test.toJson
fun String.roundTripAsArray() = singleArray(fromJsonObject(execute().toJson()))
fun String.roundTripAsScalar() = singleScalar(fromJsonObject(execute().toJson()))
// This code was freely adapted from https://github.com/koral--/jacoco-gradle-testkit-plugin
// which has this license:
/*
MIT License
Copyright (c) 2017 Karol Wrótniak Droids On Roids LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
16:08:20.654 [serv] INFO jms - 817.280 Server started
16:08:20.745 [main] INFO jms - 914.939 SENT: 1
16:08:20.746 [serv] INFO jms - 916.178 RECEIVED: 1 message:
16:08:20.756 [serv] INFO jms - 926.192 Reply sent
16:08:20.757 [main] INFO jms - 926.610 Matched: 1 message:
16:08:21.264 [main] INFO jms - 433.823 SENT: 2
16:08:21.264 [serv] INFO jms - 434.285 RECEIVED: 2 message:
16:08:21.274 [serv] INFO jms - 444.227 Reply sent
16:08:21.278 [main] INFO jms - 448.310 Matched: 2 message:
16:08:21.783 [main] INFO jms - 953.214 SENT: 3
package net.gtod.cusoon
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.lang.Thread.sleep
import java.text.DecimalFormat
import javax.jms.ExceptionListener
import javax.jms.JMSException
import javax.jms.Session
package net.gtod.cusoon
import com.xenomachina.argparser.ArgParser
import com.xenomachina.argparser.mainBody
import net.gtod.cusoon.batchjobs.batchJobsDaemon
import org.apache.activemq.ActiveMQConnectionFactory
import org.slf4j.LoggerFactory
import java.lang.Thread.sleep
import javax.jms.DeliveryMode
import javax.jms.ExceptionListener
@gtod
gtod / group-parents.pl
Created July 19, 2015 23:14
Consolidate git commits to hypothetical working day intervals (IVT use)
#!/usr/bin/perl
# 13 July 2015
# Gregory Tod
# Pre-requisites
# Install PostgreSQL (simple enough on ubuntu/debian)
# Become the postgres user and do 'createuser -s <unix-username>'
# for your Linux user name (this means you can now make databases).
# By all means, use MySQL instead. My SQL foo on MySQL was too weak
# to do this quickly. You will need to work on the SQL itself, which
@gtod
gtod / trivial-du.php
Created April 15, 2015 22:38
A trivial du in PHP.
#!/usr/bin/php
<?php
require_once __DIR__ . '/vendor/autoload.php';
const DIR_SEP = DIRECTORY_SEPARATOR;
/* Implementation */
// From http://jeffreysambells.com/2012/10/25/human-readable-filesize-php
@gtod
gtod / gist:ab630648207158d5260e
Last active August 29, 2015 14:16
Common Lisp system relative pathnames
;; Simple method to get relative dir in Common Lisp
;; From http://www.reddit.com/r/lisp/comments/2yo0e7/file_data_loading_and_paths/
(defvar *base-pathname* (or *load-truename* *compile-file-truename*))
(defun asset-path (file) (merge-pathnames file *base-pathname*))
(asset-path "foo.png") => "/Path/to/project/foo.png"

On cl-rethinkdb *sequence-type*

According to https://github.com/orthecreedence/cl-rethinkdb#sequence-type this may be set to :list or :array.

Firstly, to be very clear, *sequence-type* only determines the type of sequences that cl-rethinkdb returns to you. It does not determine what types of sequences (lists or vectors in common lisp) that you may send to cl-rethinkdb for inserting or updating.