Skip to content

Instantly share code, notes, and snippets.

View nkconnor's full-sized avatar
⌨️
coding

Nicholas Connor nkconnor

⌨️
coding
View GitHub Profile
@nkconnor
nkconnor / expenditure_histogram.py
Last active October 5, 2018 15:26
MEPS respondent expenditure histogram
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
import meps
survey = meps.as_dataframe("h192")
fig, ax = plt.subplots(1, 1, figsize=(9, 4))
fmt = '${x:,.0f}'
tick = mtick.StrMethodFormatter(fmt)
@nkconnor
nkconnor / RemoteAkka.scala
Created January 12, 2018 14:57 — forked from earldouglas/RemoteAkka.scala
Remotely load and register Akka Actor classes at runtime (see https://github.com/JamesEarlDouglas/akka-remote-class-loading)
package com.earldouglas.remoteakka
import akka.actor.Actor
import akka.actor.Actor._
case object Greeting
case class Jar(val bytes: Array[Byte])
case class RegisterRemote(val name: String, val className: String)
object Runner {
@nkconnor
nkconnor / gist:503d8515d5b57b450c214bcdb5a409be
Created January 20, 2017 21:41 — forked from satyatechsavy/gist:9cebd2f5e8b85753bd2e
AWS EB-Extension to install PhantomJS
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/04_install_phantomjs":
mode: "000777"
owner: root
group: root
content: |
#!/usr/bin/env bash
set -xe
import breeze.linalg._
import breeze.math._
import breeze.numerics._
case class BernoulliTrial(outcome: Boolean)
object Experiment {
def apply(successes: Int, failures: Int) = new Experiment(successes, failures)
}