Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Fox JoshuaFox

View GitHub Profile
View Squares.clj
(defn square [x] (* x x))
(defn squares [] (map square (range 4)))
View Squares.java
public static List<Integer> main() {
List<Integer> result = new ArrayList<>();
for (int i = 0; i < 4; i++) {
result.add(i * i);
}
return result;
}
View Squares.java
public static List<Integer> main() {
List<Integer> result = new ArrayList<>();
for (int i = 0; i < 4; i++) {
result.add(i * i);
}
return result;
}
View Squares.java
public static List<Integer> main() {
List<Integer> result = new ArrayList<>();
for (int i = 0; i < 4; i++) {
result.add(i * i);
}
return result;
}
View gist:5b4af62e07dd170231ffd7a632ad48e8
~ % dig joshuafox.com
;; ANSWER SECTION:
joshuafox.com. 3600 IN A 185.199.109.153
joshuafox.com. 3600 IN A 185.199.108.153
joshuafox.com. 3600 IN A 185.199.110.153
joshuafox.com. 3600 IN A 185.199.111.153
View Log filter to see Export
resource.type="datastore_database"
protoPayload.methodName="google.datastore.admin.v1.DatastoreAdmin.ExportEntities"
@JoshuaFox
JoshuaFox / FourExecutorThreads.java
Last active Jun 16, 2020
Reduce the number of executor threads used by PubSub Publisher
View FourExecutorThreads.java
ExecutorProvider executorProvider =
InstantiatingExecutorProvider.newBuilder().setExecutorThreadCount(4).build();
Publisher.Builder builder =
Publisher.newBuilder(ProjectTopicName.of(proj, topic)).setExecutorProvider(executorProvider);
@JoshuaFox
JoshuaFox / PubSubThreads.java
Last active Oct 27, 2020
Limiting the number of threads used by PubSub publisher
View PubSubThreads.java
//Thanks to ajaaym https://github.com/googleapis/java-pubsub/issues/27#issuecomment-538508100
final ExecutorProvider fixedExecutorProvider = FixedExecutorProvider.create(
new ScheduledThreadPoolExecutor(1)); //adjust the size
Publisher publisher =
Publisher.newBuilder("topic_name")
.setExecutorProvider(fixedExecutorProvider)
.setChannelProvider(
PublisherStubSettings.defaultGrpcTransportProviderBuilder()
.setExecutorProvider(fixedExecutorProvider)
.setChannelConfigurator(
View keybase.md

Keybase proof

I hereby claim:

  • I am joshuafox on github.
  • I am joshuafox (https://keybase.io/joshuafox) on keybase.
  • I have a public key ASA7NpqoM0BdtWHpgHjB6Ik6N0BEku6OCSVgwgq3BIAnBwo