Skip to content

Instantly share code, notes, and snippets.

@laser
laser / experiment.java
Last active October 27, 2016 03:53
Java Type System-Sadness
package com.erinswensonhealey.experiments;
import java.time.Instant;
import java.util.List;
import java.util.stream.Collectors;
public class Experiment {
public interface HasCreatedAtTimestamp<T extends HasCreatedAtTimestamp<T>> {
Instant getCreatedAtTimestamp();
{
"assortedCcId": "9f4eb14e-d0d5-4e97-94f1-2f9875d62b46",
"averagePerStore": 1.0138666666666667,
"bmc": {
"brandId": "4",
"channelCode": null,
"channelId": "1",
"hierarchyName": null,
"hierarchyNodeId": null,
"legacy": false,
```
✘-1 ~/dev/gap/allocation-web [master|⚑ 1]
13:28 $ cf logs target-inventory-service-showcase
Connected, tailing logs for app target-inventory-service-showcase in org allocation / space showcase as erin_swenson-healey@gap.com...
2016-08-17T13:28:14.51-0700 [HEALTH/0] OUT healthcheck passed
2016-08-17T13:28:14.53-0700 [HEALTH/0] OUT Exit status 0
2016-08-17T13:28:22.44-0700 [APP/0] OUT 2016-08-17 13:28:22,425 ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] [http-nio-8080-exec-6] Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.netflix.hystrix.exception.HystrixRuntimeException: getDemandForecastFor short-circuited and fallback failed.] with root cause
2016-08-17T13:28:22.44-0700 [APP/0] OUT rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: 7724694c-4d2c-4614-99d7-a43e07b06f8d
2016-08-17T13:28:22.44-0700 [APP/0] OUT at rx.exceptions.OnErrorThrowable.addValueAsLastCause(On
@laser
laser / dependencies.gradle
Created August 4, 2016 19:00
Gradle Woes
configurations {
all*.exclude module : 'spring-boot-starter-logging'
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-web') {
exclude module: 'jackson-databind'
}
compile 'com.fasterxml.jackson.core:jackson-core:2.7.0'
compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
@laser
laser / stuff.md
Last active July 29, 2016 21:01
Concurrent Stuff

Concurrency Stuff

If you want to just run the code, check out either of these two branches:

To make a request that will poke the code path I edited, do this:

@laser
laser / card-groupId-change.md
Last active June 20, 2016 15:36
stickies notes

Changing a Card's groupId

These are all the ways in which a card's groupId can be changed after it's been instantiated.

Receive a card.move message

  • handler: onCardMove

Drop a card onto a card

@laser
laser / errors.md
Last active May 16, 2016 20:54
Error Proposal
@laser
laser / access-token-lifespan.md
Last active April 1, 2016 18:14
How long should access tokens (implicit grant) last for?

Fitbit

https://dev.fitbit.com/docs/oauth2/

Access tokens from the Implicit Grant Flow are longer lived than tokens from the Authorization Code Grant flow. Users may specify the lifetime of the access token from the authorization page when an application uses the Implicit Grant flow. The access token lifetime options are 1 day, 1 week, and 30 days. Applications can pre-select a token lifetime option, but the user ultimately decides.

Facebook

https://developers.facebook.com/docs/facebook-login/access-tokens#usertokens

@laser
laser / decisions.md
Last active March 31, 2016 18:29
Decisions

What Should I Do Next?

  1. Build something that allows Mateen's JIRA plugin to access protected resources w/out thinking about OAuth 2.0
  2. Build something that allows Mateen's JIRA plugin to access protected resources through an OAuth 2.0 adapter
  3. Stop thinking about Mateen's JIRA plugin
@laser
laser / dispatch.hs
Created March 31, 2016 15:26
Dynamic / Dispatch
module Dispatch where
import Data.Dynamic
import Control.Monad.Reader.Class
-- THINGS WE WANT
-- 1. we want to avoid having to duplicate the type of the members of a
-- type class in our test (like Fixture)
-- 2. we want to be able to record the arguments applied to a test function
-- 3. we want to be able to control the return value from a test function