Skip to content

Instantly share code, notes, and snippets.

View chids's full-sized avatar
👻
Not my 🎪, not my 🐒's.

Mårten Gustafson chids

👻
Not my 🎪, not my 🐒's.
View GitHub Profile
@chids
chids / x.sh
Last active April 4, 2018 09:30
#!/usr/bin/env bash
echo
echo $1
echo $2
echo

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@chids
chids / aws-sns-messageattributes-query-params.md
Created October 1, 2016 09:53
AWS SNS MessageAttributes query param format
  • MessageAttributes.entry.1.Name=foo
  • MessageAttributes.entry.1.Value.DataType=String
  • MessageAttributes.entry.1.Value.StringValue=bar

...?MessageAttributes.entry.1.Name=foo&MessageAttributes.entry.1.Value.DataType=String&MessageAttributes.entry.1.Value.StringValue=bar&...

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

package inception.commands;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import javax.ws.rs.client.Entity;
import org.mockito.ArgumentMatcher;
public class UnfuckEntity extends ArgumentMatcher<Entity<?>> {
# CATS
http = require 'http'
module.exports = (robot) ->
robot.hear /(\W|^)cat[sz]*(\W|$)/i, (msg) ->
options =
host: 'thecatapi.com',
port: 80,
path: '/api/images/get?format=src&type=gif'
http.get options, (res) ->
@chids
chids / 256kb.json
Last active March 18, 2024 16:07
Roughly 256kb of indented JSON i.e. AWS SNS and AWS SQS message limit and a hint not to publish pretty printed JSON ;)
[
{
"id": 0,
"guid": "1b8c3019-c0b6-44f9-b35c-5b1b2729551a",
"isActive": true,
"balance": "$3,163.00",
"picture": "http://placehold.it/32x32",
"age": 32,
"name": "Saunders Sosa",
"gender": "male",

So I guess I should explicitly exclude joda-time from the dropwizard-core dep and then declare it as an explicit dependency in my pom, thus locking down the version I actually want?

[WARNING] 
Dependency convergence error for joda-time:joda-time:2.2 paths to dependency are:
+-my:component:0.0.3-SNAPSHOT
  +-com.yammer.dropwizard:dropwizard-core:0.6.2
    +-joda-time:joda-time:2.2
and
+-my:component:0.0.3-SNAPSHOT
@chids
chids / DropwizardPorts.java
Created November 1, 2012 14:23
Runtime setting of Dropwizard HTTP and admin port
package omni.backend.pipeline.service.ports;
import static com.google.common.collect.Maps.immutableEntry;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import org.elasticsearch.common.collect.ImmutableMap;
import com.yammer.dropwizard.config.HttpConfiguration;
@chids
chids / gist:3748732
Created September 19, 2012 09:41
jdk-7-b147-linux-os-sleep
int os::sleep(Thread* thread, jlong millis, bool interruptible) {
assert(thread == Thread::current(), "thread consistency check");
ParkEvent * const slp = thread->_SleepEvent ;
slp->reset() ;
OrderAccess::fence() ;
if (interruptible) {
jlong prevtime = javaTimeNanos();