Skip to content

Instantly share code, notes, and snippets.

Eric Kidd emk

Block or report user

Report or block emk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
emk / phase.ks
Created Feb 18, 2018
Kerbal Space Program satellite orbit phasing using kOS and MechJeb
View phase.ks
// Change the phase of your orbit, that is, advance yourself a certain
// amount of time along the same orbit path.
// See for the math and lots
// of explanations.
// AUTHOR: Eric Kidd.
// REQUIREMENTS: To run this, you'll need Kerbel Space Program, the kOS mod,
// and a computer on your craft.
emk / nginx-proxy-taskdef-draft.json
Created May 14, 2017
nginx-proxy ECS config (untested)
View nginx-proxy-taskdef-draft.json
"containerDefinitions": [
"name": "nginx-proxy",
"image": "",
"memory": "128",
"essential": true,
"portMappings": [
"hostPort": "443",
emk / Application.elm
Created Dec 1, 2015
Elm case matching on complex records?
View Application.elm
type alias Model =
{ errorMessage: Maybe String -- This is what Rails would call a "flash": we just show it.
, video: Maybe Video.Model -- Information about a video and subtitles.
, player: Maybe VideoPlayer.Model -- Player state: URL, playing/paused, time.
type Action
= VideoLoaded Video.Model
| VideoPlayerAction VideoPlayer.Action
emk /
Last active Aug 29, 2015
Implementing traits for function types?
// Based on:
// Build on branch:
trait Foo {}
impl Foo for fn() {}
emk / gist:51dee73348e2cc5f4077
Created Apr 29, 2015
Vault's GitHub auth module doesn't explain its config options
View gist:51dee73348e2cc5f4077
$ vault help auth/github/config
Error reading help: Error making API request.
Code: 500. Errors:
* unsupported operation

Keybase proof

I hereby claim:

  • I am emk on github.
  • I am emk ( on keybase.
  • I have a public key whose fingerprint is C641 D85B 8218 678E 41F5 7961 5533 ABC9 38D4 BE26

To claim this, I am signing this object:

emk / csv2pbo
Created Dec 23, 2014
Convert CSV files to PBO parallel bilingual books
View csv2pbo
#!/usr/bin/env ruby
# Usage:
# csv2pbo book.csv > book.pbo
require 'csv'
path = ARGV[0]
# PBO format _looks_ like XML, but the parser is very fragile. So we
emk /
Created Dec 15, 2014
Multithreaded trait access
use std::sync::Arc;
use std::sync::RWLock;
use std::task::spawn;
trait Common : Sized + Send + Sync {
fn munge(&mut self);
struct Foo { i: int }
emk /
Created Dec 12, 2014
Can't call through trait
/// Call the global JavaScript function named `fn_name` with `args`, and
/// return the result.
pub fn call<'a>(&mut self, fn_name: &str,
args: &[&Encodable<Encoder<'a>, DuktapeError>]) ->
unsafe {
assert_stack_height_unchanged!(self, {
fn_name.with_c_str(|c_str| {
emk /
Created Dec 10, 2014
Having trouble with Rust encoder lifetime & trait
// Try this on
extern crate libc;
extern crate serialize;
use std::ptr::null_mut;
use libc::c_void;
// This needs to be mutable in practice.
pub struct Context;
You can’t perform that action at this time.