Skip to content

Instantly share code, notes, and snippets.

View wwsean08's full-sized avatar

Sean Smith wwsean08

View GitHub Profile
func sendMessage(_ js.Value, _ []js.Value) interface{} {
doc := js.Global().Get("document")
msg := doc.Call("getElementById", "message").Get("value").String()
user := doc.Call("getElementById", "username").Get("value").String()
doc.Call("getElementById", "message").Set("value", "")
println(user, msg)
location := js.Global().Get("window").Get("location")
scheme := "ws"
if location.Get("protocol").String() == "https:" {
@wwsean08
wwsean08 / ami_prune.py
Last active August 25, 2017 07:14
A lambda function that can be used to prune AMIs based on how old they are
from __future__ import print_function
import os
import boto3
from datetime import datetime, timedelta
from dateutil.parser import parse
THRESHOLD = int(os.getenv('threshold_days', 30))
ENABLE_DELETE = os.getenv('enable_delete', False)
REGION = os.getenv('region', 'us-east-1')