Skip to content

Instantly share code, notes, and snippets.

James Cooper coopernurse

Block or report user

Report or block coopernurse

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
@coopernurse
coopernurse / freelance_producer_coop.md
Last active Nov 21, 2019
Software Freelancer Producer Co-Op
View freelance_producer_coop.md

Motivation

  • Freelancers (be they contractors or consultants) live and die by lead generation
  • Most lead generation is word of mouth (trust based)
  • Good clients are hard to find
  • Bias towards avoiding downtime (gotta pay that mortgage)

This leads to the following:

  • Over time, freelancers will sign long term retainers with their best clients.
View maelstrom.yml
#
# Maelstrom project file for bookstack
# https://maelstromapp.com/
# https://www.bookstackapp.com/
#
# Dependencies: mysql or mariadb, docker, maelstrom
#
---
name: bookstack
components:
@coopernurse
coopernurse / abstract.md
Created Jul 28, 2018
SeaGL 2018 Proposal
View abstract.md

Title

Robust image resizing

Abstract

If your application handles images you've probably written something to crop and resize them. It's simple enough to execute ImageMagick with the appropriate flags, but is that sufficient?

In this talk we will:

View ReproDiskConsistency.java
package com.imprev.util;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.ObjectListing;
import com.amazonaws.services.s3.model.S3Object;
import com.amazonaws.services.s3.model.S3ObjectSummary;
import com.imprev.soa.util.*;
import org.apache.log4j.Logger;
View RedisThreadingTest.java
package com.imprev.util;
import com.imprev.soa.redis.JedisRetry;
import com.imprev.soa.util.Log4JInit;
import com.imprev.soa.util.RandomString;
import com.imprev.soa.util.RedisTTLCache;
import org.junit.Test;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
View gist:e00421969baef292083f62f4ea545a80
Send some messages
------------------
james ~/src/imprev/docker/images/ftp-s3-sync $ aws sqs send-message --queue-url $Q_URL --message-body 'message-0'
{
"MD5OfMessageBody": "8ab5fbd7628b8c70d0382fc34fd601af",
"MessageId": "4a8616a8-3b62-42a5-bb2b-6a1f53e715e2"
}
james ~/src/imprev/docker/images/ftp-s3-sync $ aws sqs send-message --queue-url $Q_URL --message-body 'message-1'
View MyData.java
import com.fasterxml.jackson.databind.ObjectMapper;
public class MyData {
public static void main(String argv[]) throws Exception {
String json = "{\"name\": \"foo\", \"age\": 30 }";
MyData d = new ObjectMapper().readValue(json, MyData.class);
System.out.println(" json: " + json);
System.out.println("deserialized: " + d);
}
@coopernurse
coopernurse / entity-sync.md
Last active May 18, 2017
entity sync spec
View entity-sync.md

incremental entity fetch

entity-change-log

Description:

This endpoint returns a paginated list of changes in the system. Calling systems can use this to periodically fetch the list of entities that have been modified over a given time period.

View input-account-plan.json
{
"resourceKey": {
"EDE_PROPERTY_ADDRESS": "999 Pine Ave."
},
"symbol": {
"view_1.disclaimer_1": "Guaranteed or Your Money Back",
"agent_1.photo_1": "http://acme-broker.example.com/agents/agent-1.jpg"
}
}
View FooException.java
public class FooException extends Exception {
public enum Type {
notFound(404), alreadyExists(401), emailInvalid(401);
private int httpStatusCode;
Type(int httpStatusCode) {
this.httpStatusCode = httpStatusCode;
You can’t perform that action at this time.