Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
REGION=$(curl -s $EC2_METADATA/dynamic/instance-identity/document | jq -r '.region')
INSTANCE_ID=$(curl -s $EC2_METADATA/meta-data/instance-id);
INSTANCE_IP=$(curl -s $EC2_METADATA/latest/meta-data/local-ipv4);
cat > /etc/init.d/cloudmap-register <<-EOF
#! /bin/bash -ex
aws servicediscovery register-instance \
View gist:a9fa47ef09a2daa2ca5c9aca1fc73207
Largest 1000 Cities in America
2013 popuation data - Biggest US Cities By Population
rank,city,state,population,2000-2013 growth
1,New York,New York,8405837,4.8%
2,Los Angeles,California,3884307,4.8%
chrisalbright / TypeClass.scala
Created May 28, 2019
Exploration of Type Classes in Scala
View TypeClass.scala
* I'm trying to learn type classes in Scala. I've got
* a decent handle on Scala itself, but the intricacies
* of the Type system are still foreign to me.
* I decided to start with what I thought would be a
* simple enough problem: Convert a Thing into a String
object TypeClass {
chrisalbright /
Created May 17, 2019 — forked from bastman/
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

chrisalbright / ShapelessCoproduct.scala
Created May 17, 2019 — forked from fancellu/ShapelessCoproduct.scala
Examples with Shapeless 2.0, easier to understand from examples. Taken from docs, more examples/comments added etc
View ShapelessCoproduct.scala
// Coproduct is extension of Either concept, to N multually exlusive choices
type ISB = Int :+: String :+: Boolean :+: CNil
val isb = Coproduct[ISB]("foo") //> isb : qaaz.ISB = foo[Int] //> res0: Option[Int] = None[String] //> res1: Option[String] = Some(foo)

Keybase proof

I hereby claim:

  • I am chrisalbright on github.
  • I am chrisalbright ( on keybase.
  • I have a public key ASCdMBAs9JenzGWR0Py3YKnO1jGUeVRGA8bofGT2OTcl3Qo

To claim this, I am signing this object:

chrisalbright / date.abnf
Created Jul 7, 2016 — forked from robjens/date.abnf
A few BNF files I co(rr|ll)ected for Instaparse
View date.abnf
; and
oneToNine = "01" / "02" / "03" / "04" / "05" / "06" / "07" / "08" / "09"
zeroToNine = "00" / oneToNine
oneToTwelve = oneToNine / "1" ( "0" / "1" / "2" )
oneToThirteen = oneToTwelve / "13"
View MultipleOutputsExample.scala
/* Example using MultipleOutputs to write a Spark RDD to multiples files.
Based on saveAsNewAPIHadoopFile implemented in org.apache.spark.rdd.PairRDDFunctions, org.apache.hadoop.mapreduce.SparkHadoopMapReduceUtil.
val values = sc.parallelize(List(
("fruit/items", "apple"),
("vegetable/items", "broccoli"),
("fruit/items", "pear"),
("fruit/items", "peach"),
("vegetable/items", "celery"),
("vegetable/items", "spinach")
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname

Your Vision

What is a vision?

Your vision answers the question "What do I want?" A clear vision help you communicate why you're here and what impact you're going to have.

Your vision should be aligned with the company vision, with your manager's V2MOM, and it should be personal. It should be an honest reflection of your own vision for your own work.

If you manage a team, it should be reflective of the purpose of the team and your collective impact.