Skip to content

Instantly share code, notes, and snippets.

View nkconnor's full-sized avatar
⌨️
coding

Nicholas Connor nkconnor

⌨️
coding
View GitHub Profile
// https://www.epochconverter.com/
//
// What is epoch time?
// The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number
// of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not
// counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking
// the epoch is Unix time 0 (midnight 1/1/1970), but 'epoch' is often used as a
// synonym for Unix time. Some systems store epoch dates as a signed 32-bit
// integer, which might cause problems on January 19, 2038
// (known as the Year 2038 problem or Y2038). The converter on this page converts
@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)
}