Skip to content

Instantly share code, notes, and snippets.

View justinm's full-sized avatar

Justin McCormick justinm

View GitHub Profile
@justinm
justinm / cloudformation-template.yaml
Last active October 22, 2023 08:08 — forked from matt2005/lambda_function.py
Alexa Smart Home Skill Adapter for Home Assistant
# To use this template, see the example CLI command below or use the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation/home.
# aws cloudformation create-stack --stack-name homeassistant-skill --template-body file://lambda.yaml
# --parameters ParameterKey=BaseUrl,ParameterValue=[XXX] ParameterKey=SkillId,ParameterValue=[XXX] --capabilities CAPABILITY_IAM
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
Copyright: Justin McCormick <me@justinmccormick.com>
License: Apache-2.0
Description: |
This template creates a Lambda function that acts as a proxy between Alexa and Home Assistant.
The Lambda was sourced from https://gist.github.com/matt2005/744b5ef548cc13d88d0569eea65f5e5b.
id: rooms/square
type: ROOM
area: tirun
name: Tirun Park
longDescription: |
%^CYAN%^Tirun Central Park%^RESET%^\n
The park of Tirun is situated in the center of market square.
It is a place of peace and rest dedicated to the Gods of the
realm. The bustling activity of the town does not encroach
upon this place. Not even time invades this sanctuary of
@justinm
justinm / local_options
Created September 12, 2019 15:11
FluffOS Local Options
// This file contains detailed readme for each local_options option.
/****************************************************************************
* EVERY time you change ANYTHING in this file, RECOMPILE from scratch. *
* (type "make clean" then "make" on a UNIX system) Failure to do so may *
* cause the driver to behave oddly. *
****************************************************************************/
#ifndef _LOCAL_OPTIONS_H_
#define _LOCAL_OPTIONS_H_
@justinm
justinm / index.js
Created July 18, 2019 23:43
Deploy AWS EKS via Lambda
/**
* The KubeConfig must be passed in via the ENV variable KUBECONFIG.
*/
const AWS = require('aws-sdk')
const tmp = require('tmp')
const unzip = require('unzip')
const fs = require('fs')
const child_process = require('child_process')
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "The AWS CloudFormation template for this Serverless application",
"Resources": {
"ServerlessDeploymentBucket": {
"Type": "AWS::S3::Bucket"
},
"HelloLogGroup": {
"Type": "AWS::Logs::LogGroup",
"Properties": {
@justinm
justinm / okta-auth
Last active February 7, 2018 06:39
Script to support multi-terminal authentication with okta-awscli
#!/bin/bash -e
CREDENTIALS_CACHE="$HOME/.okta-credentials.cache"
if [ ! -f $CREDENTIALS_CACHE ] || test `find "$CREDENTIALS_CACHE" -mmin +120`
then
okta-awscli --cache
# If okta-awscli exits with a non-zero status code, the next line will not run
source $CREDENTIALS_CACHE
else
source $CREDENTIALS_CACHE
@justinm
justinm / keybase.md
Last active September 14, 2019 18:27

Keybase proof

I hereby claim:

  • I am justinm on github.
  • I am justinmccormick (https://keybase.io/justinmccormick) on keybase.
  • I have a public key whose fingerprint is DE93 F3BF C380 DBA5 294B 0858 066B 6FF7 00D2 21D5

To claim this, I am signing this object:

import org.springframework.context.annotation.Configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
@Configuration
public class AppConfig {
@Bean
public Initializer initializer() {
return new Initializer();
}
it "filters out projects based on search terms" do
get :index, { q: {category_cont: "clothing"}}
assigns(:projects).should_not include(project)
end
@justinm
justinm / ad_dialogs.tpl.php
Created September 8, 2011 06:01 — forked from justinpeterman/ad_dialogs.tpl.php
global scope variable
<?php
if(!empty($social_dialog)): //Step 4: Ok, was anything generated during that pages/element loop?
echo $social_dialog; //print out the html string generated if so...
endif;
?>