Skip to content

Instantly share code, notes, and snippets.

View alexmherrmann's full-sized avatar

Alex Herrmann alexmherrmann

View GitHub Profile
@alexmherrmann
alexmherrmann / termui_event_viewer.go
Created June 26, 2019 15:26
Use a fun little termui app to show event ids so you can see what termui is thinking. Run it and mash some keys, click the mouse and stuff and you'll see events fill up pretty quick!
package main
import (
"fmt"
"github.com/gizak/termui/v3"
"github.com/gizak/termui/v3/widgets"
)
const eventMax = 30
@alexmherrmann
alexmherrmann / README.md
Created March 9, 2019 09:57
Elastic Beanstalk terraform output parser

If you've ever created an elastic beanstalk environment in terraform and tried to change just a single setting on the environment you'll know why I made this. Basically it takes the output of the plan command that looks like this:

...
      setting.2207777926.name:      "StreamLogs" => "StreamLogs"
      setting.2207777926.namespace: "aws:elasticbeanstalk:cloudwatch:logs" => "aws:elasticbeanstalk:cloudwatch:logs"
      setting.2207777926.resource:  "" => ""
      setting.2207777926.value:     "false" => "false"
      setting.2262995125.name:      "Availability Zones" => "Availability Zones"
      setting.2262995125.namespace: "aws:autoscaling:asg" => "aws:autoscaling:asg"
      setting.2262995125.resource:  "" => ""
bind-key -T prefix M-'"' split-window
bind-key -T prefix M-% split-window -h
# Work the same as the normal C-" and C-% but open in the same directory as the pane split from
bind-key -T prefix '"' split-window -c "#{pane_current_path}"
bind-key -T prefix % split-window -h -c "#{pane_current_path}"
@alexmherrmann
alexmherrmann / docker-get-ip.sh
Last active March 1, 2017 06:48
Get the ip address of a docker container (with optional network argument)
#!/usr/bin/env bash
if [ ! -z "$2" ]; then
command="docker inspect -f {{.NetworkSettings.Networks.$2.IPAddress}} $1"
# echo $command
result=`$command`
else
comand="docker inspect -f {{.NetworkSettings.IPAddress}} $1"
# echo $command
@alexmherrmann
alexmherrmann / dub.json
Last active February 25, 2016 19:48
tiny_markdown_server
{
"name": "markdown-server",
"description": "A minimal D application.",
"copyright": "Copyright © 2016, alex",
"authors": ["alex"],
"dependencies": {
"vibe-d": "~>0.7.27"
},
"versions": ["VibeDefaultMain"]
}