Skip to content

Instantly share code, notes, and snippets.

Jonathan Haber jhaber

  • HubSpot
Block or report user

Report or block jhaber

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:0927fc09486c375962e97cbf79d87ed5
https://tools.hubteamqa.com/graphiql/?apiSubdomain=api&path=graphql%2Fcrm&auth=app&portalId=99561455&query=mutation%20createContactSecondaryEmail(%24createInput%3A%20CreateContactSecondaryEmailAddressInput!)%20%7B%0A%20%20createContactSecondaryEmailAddress(input%3A%20%24createInput)%20%7B%0A%20%20%20%20updatedObject%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20...%20on%20Contact%20%7B%0A%20%20%20%20%20%20%20%20defaultProperties%20%7B%0A%20%20%20%20%20%20%20%20%20%20firstname%0A%20%20%20%20%20%20%20%20%20%20email%0A%20%20%20%20%20%20%20%20%20%20hs_additional_emails%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20userErrors%0A%20%20%7D%0A%7D%0A%0Amutation%20updateContactSecondaryEmailAddress(%24updateInput%3A%20UpdateContactSecondaryEmailAddressInput!)%20%7B%0A%20%20updateContactSecondaryEmailAddress(input%3A%20%24updateInput)%20%7B%0A%20%20%20%20updatedObject%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20...%20on%20Contact%20%7B%0A%20%20%20%20%20%20%20%20defaultProp
View CustomExecutorListener.java
public class CustomExecutorListener<REQ> extends Listener<REQ> {
private final Listener<REQ> delegate;
private final ServerCall<REQ, ?> call;
private final Executor executor;
private CustomExecutorListener(
Listener<REQ> delegate,
ServerCall<REQ, ?> call,
Executor executor
) {
View StreamTimeoutClientCall.java
import java.time.Duration;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@jhaber
jhaber / ListenableServer.java
Last active May 3, 2018
Make it possible to attach listeners to io.grpc.Server
View ListenableServer.java
package grpc.example;
import io.grpc.Server;
public abstract class ListenableServer extends Server {
public abstract void addListener(ServerListener listener);
}
View no-normalized.txt
➜ ~ ls -ltr .m2/repository/com/hubspot/project-structure-maven-plugin/1.0-SNAPSHOT
total 96
-rw-r--r-- 1 jhaber staff 199 Mar 1 16:51 resolver-status.properties
-rw-r--r-- 1 jhaber staff 40 Mar 1 16:51 project-structure-maven-plugin-1.0-20180227.182835-13.pom.sha1
-rw-r--r-- 1 jhaber staff 1469 Mar 1 16:51 project-structure-maven-plugin-1.0-20180227.182835-13.pom
-rw-r--r-- 1 jhaber staff 40 Mar 1 16:51 project-structure-maven-plugin-1.0-20180227.182835-13.jar.sha1
-rw-r--r-- 1 jhaber staff 17596 Mar 1 16:51 project-structure-maven-plugin-1.0-20180227.182835-13.jar
-rw-r--r-- 1 jhaber staff 40 Mar 1 16:51 maven-metadata-HubSpot-Nexus.xml.sha1
-rw-r--r-- 1 jhaber staff 1001 Mar 1 16:51 maven-metadata-HubSpot-Nexus.xml
-rw-r--r-- 1 jhaber staff 286 Mar 1 16:51 _remote.repositories
View gist:8efe34bf6bb8685be34e37d8403779d1
2018-03-01 16:36:57,881 [96310919] INFO - ea.checkstyle.CheckStylePlugin - CheckStyle Plugin loaded with project base dir: "/Users/jhaber/src/Wormhole"
2018-03-01 16:36:57,882 [96310920] INFO - ellij.project.impl.ProjectImpl - 124 project components initialized in 30 ms
2018-03-01 16:36:57,882 [96310920] INFO - le.impl.ModuleManagerComponent - 0 module(s) loaded in 0 ms
2018-03-01 16:36:57,906 [96310944] INFO - ution.rmi.RemoteProcessSupport - Terminating: 39473/Maven3ServerImpl726ae692
2018-03-01 16:37:01,552 [96314590] INFO - .diagnostic.PerformanceWatcher - Post-startup activities under progress took 1ms; general responsiveness: ok; EDT responsiveness: ok
2018-03-01 16:37:01,593 [96314631] INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-03-01 16:37:01,594 [96314632] INFO - g.FileBasedIndexProjectHandler - Reindexing refreshed files: 0 to update, calculated in 0ms
2018-03-01 16:37:01,694 [96314732] INFO - g.FileBasedIndexProjectH
View example.sh
~ curl -s https://oss.sonatype.org/content/repositories/releases/com/mycila/license-maven-plugin/2.11/license-maven-plugin-2.11.pom | shasum
ca4834f90a2091bbd50cc0d72dff94c743a7fc9f -
~ curl https://oss.sonatype.org/content/repositories/releases/com/mycila/license-maven-plugin/2.11/license-maven-plugin-2.11.pom.sha1
236d8fde9973092682cc886028fbdd6f009ee907%
~ curl http://central.maven.org/maven2/com/mycila/license-maven-plugin/2.11/license-maven-plugin-2.11.pom.sha1
ca4834f90a2091bbd50cc0d72dff94c743a7fc9f%
View install-accelerator-maven-extension.sh
#!/bin/bash
set -e
libdir="$M2_HOME/lib"
cd $libdir
resolverjar=`ls maven-resolver-impl-*.jar`
tmpdir=`mktemp -d -t maven.XXXXXX`
cd $tmpdir
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>0.1-SNAPSHOT</version>
<dependencies>
<dependency>
View bootstrap-rest.txt
Result "com.hubspot.dropwizard.BootstrapRestBenchmark.hitBootstrapRest":
N = 24402
mean = 2.050 ±(99.9%) 0.063 ms/op
Histogram, ms/op:
[ 0.000, 12.500) = 24155
[ 12.500, 25.000) = 181
[ 25.000, 37.500) = 41
[ 37.500, 50.000) = 14
[ 50.000, 62.500) = 5
You can’t perform that action at this time.